Georg Brandl [EMAIL PROTECTED] added the comment:
Please apply the patch, but rename Unicode escapes to \u and \U
escapes first.
--
assignee: georg.brandl - benjamin.peterson
resolution: rejected - fixed
__
Tracker [EMAIL PROTECTED]
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Fixed in r62568.
--
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
__
___
Neal Norwitz [EMAIL PROTECTED] added the comment:
What is the status of this bug? AFAICT, the code is now correct. Have
the doc changes been applied? The resolution on this report should be
updated too. It's currently rejected.
--
nosy: +nnorwitz
__
Benjamin Peterson [EMAIL PROTECTED] added the comment:
It's rejected because the OP wanted unicode escapes to be applied in
unicode strings, and I haven't applied the docs because nobody has told
me I should.
__
Tracker [EMAIL PROTECTED]
Marc-Andre Lemburg [EMAIL PROTECTED] added the comment:
While that's true for cPickle, it is not for pickle. The pickle protocol
itself is defined in terms of the raw-unicode-escape codec (see
pickle.py).
Besides, you cannot assume that the Python interpreter itself is the
only use-case for
Marc-Andre Lemburg [EMAIL PROTECTED] added the comment:
You can't change the codec - it's being used in other places as well,
e.g. for use cases where you need to have a 7-bit encoded readable
version of a Unicode object.
Adding a new codec would be fine, though I don't know how this would map
Changes by Marc-Andre Lemburg [EMAIL PROTECTED]:
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
__
___
Python-bugs-list mailing list
Unsubscribe:
Marc-Andre Lemburg [EMAIL PROTECTED] added the comment:
You can't change the codec - it's being used in other places as well,
e.g. for use cases where you need to have an 8-bit encoded readable
version of a Unicode object (which happens to be Latin-1 + Unicode
escapes for all non-Latin-1
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Isn't unicode-escape enough for this purpose?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
__
___
Marc-Andre Lemburg [EMAIL PROTECTED] added the comment:
What do you mean with enough ?
The raw-unicode-escape codec is used in Python 2.x to convert literal
strings of the form ur to Unicode objects. It's a variant of the
unicode-escape codec.
The codec is also being used in cPickle, pickle,
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
I mean: now that raw strings cannot represent all unicode points (or
more precisely, they need the file encoding to do so), is there a use
case for raw-unicode-escape that cannot be filled by the
unicode-escape codec?
Note that pickle
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
pickle still uses it when protocol=0 (and cPickle as well, but in trunk/
only of course)
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
__
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Sorry, Guido said this is not allowed:
http://mail.python.org/pipermail/python-3000/2008-April/012952.html. I
reverted it in r62165.
--
resolution: fixed - rejected
__
Tracker [EMAIL PROTECTED]
Guido van Rossum [EMAIL PROTECTED] added the comment:
The docs still need to be updated! An entry in what's new in 3.0 should
also be added.
--
assignee: - georg.brandl
components: +Documentation -Unicode
nosy: +georg.brandl, gvanrossum
status: closed - open
Benjamin Peterson [EMAIL PROTECTED] added the comment:
How's this?
--
keywords: +patch
Added file:
http://bugs.python.org/file9947/py3k_raw_strings_unicode_escapes.patch
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
Guido van Rossum [EMAIL PROTECTED] added the comment:
Instead of ignored (which might be read ambiguously) how about not
treated specially?
You also still need to add some words to whatsnew.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
Benjamin Peterson [EMAIL PROTECTED] added the comment:
not treated specially it is!
Added file:
http://bugs.python.org/file9948/py3k_raw_strings_unicode_escapes2.patch
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
Georg Brandl [EMAIL PROTECTED] added the comment:
The segment use different rules for interpreting backslash escape
sequences. should be killed entirely, and the whole rule told here.
Also, a few paragraphs later there are more references to raw strings,
e.g. When an ``'r'`` or ``'R'`` prefix
Benjamin Peterson [EMAIL PROTECTED] added the comment:
I made the requested improvements and mentioned it in NEWS. Is there
worth putting in the tutorial, since it mentions Unicode strings and raw
strings?
Added file:
http://bugs.python.org/file9952/py3k_raw_strings_unicode_escapes3.patch
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
What about the raw-unicode-escape codec?
Can we leave it different from raw strings literals?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
__
Benjamin Peterson [EMAIL PROTECTED] added the comment:
You use the ur string mode.
print ur\u0020
--
nosy: +benjamin.peterson
resolution: - invalid
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Thanks for noticing, Amaury, and your patch works for me.
--
priority: - critical
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
__
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
No, it's about python 3.0. I confirm the problem, and propose a patch:
--- Python/ast.c.original 2008-04-03 15:12:15.548389400 +0200
+++ Python/ast.c2008-04-03 15:12:28.359475800 +0200
@@ -3232,7 +3232,7 @@
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Fixed in r62128.
--
resolution: - fixed
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2541
__
New submission from John Millikin [EMAIL PROTECTED]:
According to
http://docs.python.org/dev/3.0/reference/lexical_analysis.html#id9,
raw strings with \u and \U escape sequences should have these sequences
parsed as usual. However, they are currently escaped.
r'\u0020'
'\\u0020'
Expected:
25 matches
Mail list logo