We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d98fff commit b753d31Copy full SHA for b753d31
Lib/xml/etree/ElementTree.py
@@ -1202,10 +1202,7 @@ def parse(source, parser=None):
1202
"""
1203
if getattr(source, 'encoding', None) == 'ISO-8859-1' and source.mode == 'r':
1204
import warnings
1205
- warnings.warn(
1206
- "For file objects containing XML data "
1207
- "with non-ASCII and non-UTF-8 encoding (for example. ISO 8859-1), "
1208
- "the file must have been opened in binary mode.", category=RuntimeWarning)
+ warnings.warn("ISO-8859-1 encoding should be read using 'rb' mode.", category=RuntimeWarning)
1209
tree = ElementTree()
1210
tree.parse(source, parser)
1211
return tree
0 commit comments