idle 2.x and unicode literals

J

Joe P. Cool

Hi,

I'm working with Python 2.6.4 on Ubuntu 9.10 and noticed a difference
between IDLE and command line python. If I enter an é (accented e,
LATIN SMALL LETTER E WITH ACUTE) as a unicode string in command line
python I get this:
u'\xe9'

In IDLE 2.6.4 I get this:
u'\xc3\xa9'

IDLE is set to UTF-8 and console environment has LANG = en_US.UTF-8.
This is a bit annyoing because ord(u'é') works on the command line but
raises an exception in IDLE:
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
ord(u'é')
TypeError: ord() expected a character, but string of length 2 found

Is this a bug? IDLE 3.1.1 works.

Cheers,
Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top