diff options
author | Łukasz Langa <lukasz@langa.pl> | 2013-06-23 17:10:25 (GMT) |
---|---|---|
committer | Łukasz Langa <lukasz@langa.pl> | 2013-06-23 17:10:25 (GMT) |
commit | f9b4eb4d04609c6cb0f56edfd1ca3d15b349eadf (patch) | |
tree | 466679166b1990be6532af06fd4e55d4b839214e /Lib/configparser.py | |
parent | 36a7e4f74a7fdf193f0fd0fab8ace602bca490a5 (diff) | |
download | cpython-f9b4eb4d04609c6cb0f56edfd1ca3d15b349eadf.zip cpython-f9b4eb4d04609c6cb0f56edfd1ca3d15b349eadf.tar.gz cpython-f9b4eb4d04609c6cb0f56edfd1ca3d15b349eadf.tar.bz2 |
Fixed issue #18260: configparser TypeError on source name specified as bytes
Diffstat (limited to 'Lib/configparser.py')
-rw-r--r-- | Lib/configparser.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py index 6c5aa49..fde1c12 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -191,7 +191,7 @@ class DuplicateSectionError(Error): def __init__(self, section, source=None, lineno=None): msg = [repr(section), " already exists"] if source is not None: - message = ["While reading from ", source] + message = ["While reading from ", repr(source)] if lineno is not None: message.append(" [line {0:2d}]".format(lineno)) message.append(": section ") @@ -217,7 +217,7 @@ class DuplicateOptionError(Error): msg = [repr(option), " in section ", repr(section), " already exists"] if source is not None: - message = ["While reading from ", source] + message = ["While reading from ", repr(source)] if lineno is not None: message.append(" [line {0:2d}]".format(lineno)) message.append(": option ") |