changeset: 89000:791674a74e47 branch: 3.3 parent: 88997:733e19123915 user: Serhiy Storchaka date: Thu Feb 06 22:49:45 2014 +0200 files: Lib/configparser.py Lib/distutils/command/register.py Lib/test/test_hash.py description: Issue #20363. Fixed BytesWarning triggerred by test suite. Patch by Berker Peksag. diff -r 733e19123915 -r 791674a74e47 Lib/configparser.py --- a/Lib/configparser.py Thu Feb 06 21:10:41 2014 +0200 +++ b/Lib/configparser.py Thu Feb 06 22:49:45 2014 +0200 @@ -286,7 +286,7 @@ raise ValueError("Required argument `source' not given.") elif filename: source = filename - Error.__init__(self, 'Source contains parsing errors: %s' % source) + Error.__init__(self, 'Source contains parsing errors: %r' % source) self.source = source self.errors = [] self.args = (source, ) @@ -322,7 +322,7 @@ def __init__(self, filename, lineno, line): Error.__init__( self, - 'File contains no section headers.\nfile: %s, line: %d\n%r' % + 'File contains no section headers.\nfile: %r, line: %d\n%r' % (filename, lineno, line)) self.source = filename self.lineno = lineno diff -r 733e19123915 -r 791674a74e47 Lib/distutils/command/register.py --- a/Lib/distutils/command/register.py Thu Feb 06 21:10:41 2014 +0200 +++ b/Lib/distutils/command/register.py Thu Feb 06 22:49:45 2014 +0200 @@ -300,5 +300,5 @@ result = 200, 'OK' if self.show_response: dashes = '-' * 75 - self.announce('%s%s%s' % (dashes, data, dashes)) + self.announce('%s%r%s' % (dashes, data, dashes)) return result diff -r 733e19123915 -r 791674a74e47 Lib/test/test_hash.py --- a/Lib/test/test_hash.py Thu Feb 06 21:10:41 2014 +0200 +++ b/Lib/test/test_hash.py Thu Feb 06 22:49:45 2014 +0200 @@ -138,7 +138,7 @@ # an object to be tested def get_hash_command(self, repr_): - return 'print(hash(%s))' % repr_ + return 'print(hash(eval(%a)))' % repr_ def get_hash(self, repr_, seed=None): env = os.environ.copy()