[Python-checkins] commit of r41728 - in python: branches/release24-maint/Lib/test/test_unicode.py branches/release24-maint/Misc/NEWS branches/release24-maint/Objects/unicodeobject.c trunk/Lib/test/test_unicode.py trunk/Misc/NEWS trunk/Objects/uni

Hye-Shik Chang hyeshik at gmail.com
Sun Dec 18 02:17:09 CET 2005


On 12/18/05, Walter Dörwald <walter at livinglogic.de> wrote:
> hyeshik.chang wrote:
>
> > Author: hyeshik.chang
> > Date: Sat Dec 17 05:38:31 2005
> > New Revision: 41728
> >
> > Modified:
> >   python/branches/release24-maint/Lib/test/test_unicode.py
> >   python/branches/release24-maint/Misc/NEWS
> >   python/branches/release24-maint/Objects/unicodeobject.c
> >   python/trunk/Lib/test/test_unicode.py
> >   python/trunk/Misc/NEWS
> >   python/trunk/Objects/unicodeobject.c
> > Log:
> > Bug #1379994: Fix *unicode_escape codecs to encode r'\' as r'\\'
> > just like string codecs.
>
> I don't see how the patches to test_unicode.py check for this change. It just changes the check from testing one long string to
> testing each character separately.

The test have been succeeded because escape routine decodes '\<unknown>'
as '\<unknown>' itself. Therefore testing it with joined string
'....\]^....' will pass
the test because '\]' is decoded to just '\]'. But, when we change it to test
by each character separately, just r'\' can fail because no other character
followed the escape.

Hye-Shik


More information about the Python-checkins mailing list