From f9b4eb4d04609c6cb0f56edfd1ca3d15b349eadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Langa?= Date: Sun, 23 Jun 2013 19:10:25 +0200 Subject: Fixed issue #18260: configparser TypeError on source name specified as bytes --- Lib/configparser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/configparser.py') diff --git a/Lib/configparser.py b/Lib/configparser.py index 6c5aa49bab..fde1c12440 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 ") -- cgit v1.2.1