summaryrefslogtreecommitdiffstats
path: root/Lib/configparser.py
diff options
context:
space:
mode:
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)
commitf9b4eb4d04609c6cb0f56edfd1ca3d15b349eadf (patch)
tree466679166b1990be6532af06fd4e55d4b839214e /Lib/configparser.py
parent36a7e4f74a7fdf193f0fd0fab8ace602bca490a5 (diff)
downloadcpython-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.py4
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 ")