cpython: a4431dce107a (original) (raw)
Mercurial > cpython
changeset 89001:a4431dce107a
Issue #20363. Fixed BytesWarning triggerred by test suite. Patch by Berker Peksag. [#20363]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Thu, 06 Feb 2014 22:52:23 +0200 |
parents | 775fb736b4b8(current diff)791674a74e47(diff) |
children | c964b6b83720 |
files | Lib/base64.py Lib/configparser.py Lib/test/test_hash.py |
diffstat | 4 files changed, 5 insertions(+), 5 deletions(-)[+] [-] Lib/base64.py 2 Lib/configparser.py 4 Lib/distutils/command/register.py 2 Lib/test/test_hash.py 2 |
line wrap: on
line diff
--- a/Lib/base64.py +++ b/Lib/base64.py @@ -362,7 +362,7 @@ def a85decode(b, *, foldspaces=False, ad 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))[](#l1.7)
#"by {!r} and {!r}".format(_A85START, _A85END))[](#l1.8) b = b[2:-2] # Strip off start/end markers[](#l1.9)
We have to go through this stepwise, so as to ignore spaces and handle
--- 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)[](#l2.7)
Error.__init__(self, 'Source contains parsing errors: %r' % source)[](#l2.8) self.source = source[](#l2.9) self.errors = [][](#l2.10) self.args = (source, )[](#l2.11)
@@ -322,7 +322,7 @@ class MissingSectionHeaderError(ParsingE def init(self, filename, lineno, line): Error.init( self,
'File contains no section headers.\nfile: %s, line: %d\n%r' %[](#l2.16)
'File contains no section headers.\nfile: %r, line: %d\n%r' %[](#l2.17) (filename, lineno, line))[](#l2.18) self.source = filename[](#l2.19) self.lineno = lineno[](#l2.20)
--- a/Lib/distutils/command/register.py +++ b/Lib/distutils/command/register.py @@ -300,5 +300,5 @@ Your selection [default 1]: ''', log.INF result = 200, 'OK' if self.show_response: dashes = '-' * 75
self.announce('%s%s%s' % (dashes, data, dashes))[](#l3.7)
self.announce('%s%r%s' % (dashes, data, dashes))[](#l3.8) return result[](#l3.9)
--- 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")[](#l4.7)
return 'print(hash(eval(%a)))' % repr_[](#l4.8)
def get_hash(self, repr_, seed=None): env = os.environ.copy()