Staging
v0.8.1
https://github.com/python/cpython
Revision a1eb2274943e86987fdd5a4c08ebd8c301522e3b authored by Guido van Rossum on 11 October 2002, 00:09:51 UTC, committed by Guido van Rossum on 11 October 2002, 00:09:51 UTC
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.
1 parent 3d3a0fa
History
Tip revision: a1eb2274943e86987fdd5a4c08ebd8c301522e3b authored by Guido van Rossum on 11 October 2002, 00:09:51 UTC
Backport the relevant part of 2.192:
Tip revision: a1eb227
File Mode Size
.cvsignore -rw-r--r-- 22 bytes
acceler.c -rw-r--r-- 3.2 KB
bitset.c -rw-r--r-- 949 bytes
firstsets.c -rw-r--r-- 2.1 KB
grammar.c -rw-r--r-- 4.6 KB
grammar.mak -rw-r--r-- 1.1 KB
grammar1.c -rw-r--r-- 1.0 KB
intrcheck.c -rw-r--r-- 2.8 KB
listnode.c -rw-r--r-- 983 bytes
metagrammar.c -rw-r--r-- 2.1 KB
myreadline.c -rw-r--r-- 4.1 KB
node.c -rw-r--r-- 2.4 KB
parser.c -rw-r--r-- 8.7 KB
parser.h -rw-r--r-- 966 bytes
parsetok.c -rw-r--r-- 4.1 KB
pgen.c -rw-r--r-- 14.2 KB
pgen.h -rw-r--r-- 253 bytes
pgenmain.c -rw-r--r-- 3.6 KB
printgrammar.c -rw-r--r-- 2.4 KB
tokenizer.c -rw-r--r-- 17.9 KB
tokenizer.h -rw-r--r-- 1.8 KB

back to top