summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-06 22:49:45 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-06 22:49:45 +0200
commit30cda2ce4ac02cf670cb8941dae1c8ef5b5aff93 (patch)
tree121170e3bedfe8802b23684f948d65ad274db16a
parentbb5d70755378fa3f504f204258ef33b141f3699a (diff)
downloadcpython-30cda2ce4ac02cf670cb8941dae1c8ef5b5aff93.tar.gz
Issue #20363. Fixed BytesWarning triggerred by test suite.
Patch by Berker Peksag.
-rw-r--r--Lib/configparser.py4
-rw-r--r--Lib/distutils/command/register.py2
-rw-r--r--Lib/test/test_hash.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py
index aa401fc0a3..aebf8a0fb9 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -286,7 +286,7 @@ class ParsingError(Error):
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 @@ class MissingSectionHeaderError(ParsingError):
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 --git a/Lib/distutils/command/register.py b/Lib/distutils/command/register.py
index 55656c2353..b49f86fe58 100644
--- a/Lib/distutils/command/register.py
+++ b/Lib/distutils/command/register.py
@@ -300,5 +300,5 @@ Your selection [default 1]: ''', log.INFO)
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 --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py
index e3ab6e4385..22ebbccb22 100644
--- a/Lib/test/test_hash.py
+++ b/Lib/test/test_hash.py
@@ -138,7 +138,7 @@ class HashRandomizationTests:
# 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()