summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-06 20:52:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-06 20:52:23 (GMT)
commita26b3f183d1101a21c51a5bd0c75834dfe859039 (patch)
tree22d428add046e60444327110f7b57cc6bf819c6c /Lib
parenta146bef02bf26b75d8d720f444283e28e784a1e3 (diff)
parentbc27a050a7bef228c5e125c4de938faef56533fd (diff)
downloadcpython-a26b3f183d1101a21c51a5bd0c75834dfe859039.zip
cpython-a26b3f183d1101a21c51a5bd0c75834dfe859039.tar.gz
cpython-a26b3f183d1101a21c51a5bd0c75834dfe859039.tar.bz2
Issue #20363. Fixed BytesWarning triggerred by test suite.
Patch by Berker Peksag.
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/base64.py2
-rw-r--r--Lib/configparser.py4
-rw-r--r--Lib/distutils/command/register.py2
-rw-r--r--Lib/test/test_hash.py2
4 files changed, 5 insertions, 5 deletions
diff --git a/Lib/base64.py b/Lib/base64.py
index 84818cf..573f76d 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -362,7 +362,7 @@ def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
if adobe:
if not (b.startswith(_A85START) and b.endswith(_A85END)):
raise ValueError("Ascii85 encoded byte sequences must be bracketed "
- "by {} and {}".format(_A85START, _A85END))
+ "by {!r} and {!r}".format(_A85START, _A85END))
b = b[2:-2] # Strip off start/end markers
#
# We have to go through this stepwise, so as to ignore spaces and handle
diff --git a/Lib/configparser.py b/Lib/configparser.py
index c0752ce..4ee8307 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 55656c2..b49f86f 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 8687244..f647c6f 100644
--- a/Lib/test/test_hash.py
+++ b/Lib/test/test_hash.py
@@ -172,7 +172,7 @@ class HashRandomizationTests:
# an object to be tested
def get_hash_command(self, repr_):
- return 'print(hash(eval(%r.decode("utf-8"))))' % repr_.encode("utf-8")
+ return 'print(hash(eval(%a)))' % repr_
def get_hash(self, repr_, seed=None):
env = os.environ.copy()