Is unicode_escape broken?

M

mtnBikingMark

Hi,

I am confused by unicode_escape functionality - it doesn't seem to
follow string_escape functionality.

I would expect that given the same string (or at least a non-unicode
and unicode string appropriately) that they would produce more or less
the same output, but:
'\\t\\t'

(I would have expected "\\t\\\\t" )

and then round - tripping also seems to be broken for unicode_escape:u'\t\t'

Python Version "Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310
32 bit (Intel)] on win32"

Thanks
Mark
 
J

jepler

I also believe this is a bug.

Here's an even shorter demonstration of the behavior:Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in
position 0: \ at end of string

To report a bug, follow the directions at the bottom of this page:
http://www.python.org/2.4.2/bugs.html

To report a bug not listed above, always check the SourceForge Bug
Tracker[1] to see if they've already been reported. Use the bug tracker to
report new bugs. If you have a patch, please use the SourceForge Patch
Manager[2]. Please mention that you are reporting a bug in 2.4.2, and note
that you must have a SourceForge account and be logged in to submit a
bug report or patch (we require this in case we need more information
from you).

[1] http://sourceforge.net/bugs/?group_id=5470
[2] http://sourceforge.net/patch/?group_id=5470

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDn19oJd01MZaTXX0RArj/AJ0XG0bl+617gN3dwG7/M4VkpZyePgCeLh/z
7mNsUDU1M7FqWU9eA5COjlo=
=GQcK
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,274
Messages
2,571,366
Members
48,052
Latest member
EvaW192252

Latest Threads

Top