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 Jean-Michel.Fauth
Recipients Jean-Michel.Fauth, benjamin.peterson, ezio.melotti, georg.brandl, loewis, r.david.murray, terry.reedy
Date 2012-03-02.22:10:57
SpamBayes Score 6.377676e-13
Marked as misclassified No
Message-id <1330726258.18.0.147926990537.issue14176@psf.upfronthosting.co.za>
In-reply-to
Content
You do not get it or I do not explain it correctly.

I do not care if Py 3.3 accepts '...' ou u'...'. I'm only
affraid, Py 3.3 is suffering from the same non working
behaviour Python 2 is suffering. I have seen so many things...

I can only use an Py2/Py3 analogy, the types beeing differnt.

In Python 2, the u'...' and the unicode('...', 'coding') are
not equivalent. This leads and has lead to a lot of non
working code. unicode() is always working, while u'...'
may not work. A lot of libs, are accepting unicode() and are
failing in having to accept u'...'.
That would mean in Python 3, '...' works and u'...' will not work.

Once again, an *illustration* with IDLE / Py2.

>>> import unicodedata as ud
>>> for c in u'abc需':
	print ud.name(c)

	
LATIN SMALL LETTER A
LATIN SMALL LETTER B
LATIN SMALL LETTER C
LATIN SMALL LETTER E WITH ACUTE

Traceback (most recent call last):
  File "<pyshell#3>", line 2, in <module>
    print ud.name(c)
ValueError: no such name
>>> # but
>>> import sys
>>> for c in unicode('abc需', sys.stdout.encoding):
	print ud.name(c)

	
LATIN SMALL LETTER A
LATIN SMALL LETTER B
LATIN SMALL LETTER C
LATIN SMALL LETTER E WITH ACUTE
LATIN SMALL LIGATURE OE
EURO SIGN
>>> 

A course, this is actually a no problem with Py 3.

I know nothing about the internal of Python. I have however
noticed this guilty behaviour happen especially with non
iso-8859-1 chars, valid byte string chars but equivalent chars
with unicode code point > 255. Infortunately, all these chars
which are so important in French. (I heared about similar problems
with the mac-roman coding. I do not know the status).

So, if this (u'...') works in Py 3.3, the problem can
be considered as "solved".
At least you have been informed about this potential issue.
It still remains that this is a serious problem on Py 2.

jmf
History
Date User Action Args
2012-03-02 22:10:58Jean-Michel.Fauthsetrecipients: + Jean-Michel.Fauth, loewis, georg.brandl, terry.reedy, benjamin.peterson, ezio.melotti, r.david.murray
2012-03-02 22:10:58Jean-Michel.Fauthsetmessageid: <1330726258.18.0.147926990537.issue14176@psf.upfronthosting.co.za>
2012-03-02 22:10:57Jean-Michel.Fauthlinkissue14176 messages
2012-03-02 22:10:57Jean-Michel.Fauthcreate