This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients ezio.melotti, serhiy.storchaka, vstinner, zuo
Date 2013-11-10.07:05:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384067129.42.0.14957999002.issue19539@psf.upfronthosting.co.za>
In-reply-to
Content
The 'raw_unicode_escape' codec can't be neither removed nor changed because it is used in pickle protocol. Just don't use it if its behavior looks weird for you.

Right way to decode raw_unicode_escape-encoded data is use 'raw_unicode_escape' decoder.

If a string don't contain quotes, you can use eval(), but you should first decode data from latin1 and encode to UTF-8:

>>> literal = ('r"%s"' % "zażółć".encode('raw_unicode_escape').decode('latin1')).encode()
>>> literal
b'r"za\\u017c\xc3\xb3\\u0142\\u0107"'
>>> eval(literal)
'za\\u017có\\u0142\\u0107'
History
Date User Action Args
2013-11-10 07:05:29serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, ezio.melotti, zuo
2013-11-10 07:05:29serhiy.storchakasetmessageid: <1384067129.42.0.14957999002.issue19539@psf.upfronthosting.co.za>
2013-11-10 07:05:29serhiy.storchakalinkissue19539 messages
2013-11-10 07:05:28serhiy.storchakacreate