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 martin.panter
Recipients docs@python, ezio.melotti, lemburg, martin.panter, terry.reedy, vstinner, zuo
Date 2014-12-22.06:01:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419228116.31.0.0723368338311.issue19539@psf.upfronthosting.co.za>
In-reply-to
Content
[Edit Error: 'utf8' codec can't decode byte 0xe2 in position 212: invalid continuation byte]


Re-reading the suggested description, it struck me that for encoding, this is redundant with the “backslashreplace” error handler:

>>> test = "".join(map(chr, range(sys.maxunicode + 1)))
>>> test.encode("raw-unicode-escape") == test.encode("latin-1", "backslashreplace")
True

However, decoding also seems similar to “unicode_escape”, except that only \uXXXX and \UXXXXXXXX seem to be supported.

Maybe there should be a warning that backslashes are not escaped:

>>> "\\u005C".encode("raw-unicode-escape").decode("raw-unicode-escape")
'\\'
History
Date User Action Args
2014-12-22 06:01:56martin.pantersetrecipients: + martin.panter, lemburg, terry.reedy, vstinner, ezio.melotti, zuo, docs@python
2014-12-22 06:01:56martin.pantersetmessageid: <1419228116.31.0.0723368338311.issue19539@psf.upfronthosting.co.za>
2014-12-22 06:01:56martin.panterlinkissue19539 messages
2014-12-22 06:01:56martin.pantercreate