idle 2.x and unicode literals

Discussion in 'Python' started by Joe P. Cool, Apr 2, 2010.

  1. Joe P. Cool

    Joe P. Cool Guest


    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:

    In IDLE 2.6.4 I get this:

    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>
    TypeError: ord() expected a character, but string of length 2 found

    Is this a bug? IDLE 3.1.1 works.

    Joe P. Cool, Apr 2, 2010
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.