[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-28 Thread STINNER Victor

STINNER Victor added the comment:

This issue is just a documentation issue. The do must be more explicit,
explain that the codecs is only used internally by the pickle module, and
that its output cannot be used anymore by eval().

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-27 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: needs patch - resolved
superseder:  - 'codecs' module docs improvements

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-25 Thread Jan Kaliszewski

Changes by Jan Kaliszewski z...@chopin.edu.pl:


--
resolution:  - duplicate
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-25 Thread Jan Kaliszewski

Jan Kaliszewski added the comment:

My concerns are now being addressed in the issue19548.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-21 Thread Martin Panter

Martin Panter added the comment:

[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 
\u and \U seem to be supported.

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

 \\u005C.encode(raw-unicode-escape).decode(raw-unicode-escape)
'\\'

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-17 Thread Martin Panter

Martin Panter added the comment:

I included the proposed doc fix in my patch for Issue 19548

--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2013-11-15 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2013-11-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Jan, the codec implements an encoding which has certain characteristics just 
like any other codec. It works both in Python 2 and 3 without problems.

The documentation is no longer true, though. Ever since we added encoding 
markers to source files, the raw Unicode string literals depended on this 
encoding setting. Before this change the docs were fine, since Unicode literals 
were interpreted as Latin-1 encoded.

More correct would be: Produce a string that uses Unicode escapes to encode 
non-Latin-1 code points. It is used in the Python pickle protocol.

--
nosy: +lemburg
title: The 'raw_unicode_escape' codec buggy + not apropriate for Python 3.x - 
The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com