]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Backport the relevant part of 2.192:
authorGuido van Rossum <guido@python.org>
Fri, 11 Oct 2002 00:09:51 +0000 (00:09 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 11 Oct 2002 00:09:51 +0000 (00:09 +0000)
commita1eb2274943e86987fdd5a4c08ebd8c301522e3b
tree20ab2ed1017b27cec37d71d01171f0e0bb279241
parent3d3a0facb2798cfde8d959a5d83146853631a9b0
Backport the relevant part of 2.192:

The string formatting code has a test to switch to Unicode when %s
sees a Unicode argument.  Unfortunately this test was also executed
for %r, because %s and %r share almost all of their code.  This meant
that, if u is a unicode object while repr(u) is an 8-bit string
containing ASCII characters, '%r' % u is a *unicode* string containing
only ASCII characters!

Fixed by executing the test only for %s.
Objects/stringobject.c