FAQ
Hi,
I am having problems with acentuation on python.
Before, I used to have win98 with python 2.2.3. Everything worked perfectly.
Now, I?ve updated my OS to Windows 2000 and have problems.
When I try to save on IDLE a script wich has portuguese acentuation on some strings (like "andr?"), it desn?t let me save the file, with this error.

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python22\lib\lib-tk\Tkinter.py", line 1316, in __call__
return apply(self.func, args)
File "C:\PYTHON22\Tools\idle\IOBinding.py", line 128, in save
if self.writefile(self.filename):
File "C:\PYTHON22\Tools\idle\IOBinding.py", line 151, in writefile
chars = str(self.text.get("1.0", "end-1c"))
UnicodeError: ASCII encoding error: ordinal not in range(128)

Similarly, on SHELL I can not use acentuation either.
[shell]
a = 'andr?'
UnicodeError: ASCII encoding error: ordinal not in range(128)
>>>

BUT, in a command line python, on the same OS, I can use acentuation normally, without using unicodes or escape characters.
[command line]
a = 'andr?'
Can anybody help me?

Maur?cio Infor?ati

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-list/attachments/20030812/e3e080f7/attachment.html

Search Discussions

  • Bengt Richter at Aug 12, 2003 at 7:24 pm

    On Tue, 12 Aug 2003 12:02:30 -0300, =?iso-8859-1?Q?Mauricio_Inforçati?= wrote:
    This is a multi-part message in MIME format.
    Please try to post only plain text to newsgroups.
    [...]
    Hi,
    I am having problems with acentuation on python.
    Before, I used to have win98 with python 2.2.3. Everything worked >perfectly.
    Now, I´ve updated my OS to Windows 2000 and have problems.
    When I try to save on IDLE a script wich has portuguese acentuation on >some strings (like "andré"), it desn´t let me save the file, with >this error.

    Exception in Tkinter callback
    Traceback (most recent call last):
    File "C:\Python22\lib\lib-tk\Tkinter.py", line 1316, in __call__
    return apply(self.func, args)
    File "C:\PYTHON22\Tools\idle\IOBinding.py", line 128, in save
    if self.writefile(self.filename):
    File "C:\PYTHON22\Tools\idle\IOBinding.py", line 151, in writefile
    chars = str(self.text.get("1.0", "end-1c"))
    UnicodeError: ASCII encoding error: ordinal not in range(128)

    Similarly, on SHELL I can not use acentuation either.
    [shell]
    a = 'andré'
    UnicodeError: ASCII encoding error: ordinal not in range(128)
    BUT, in a command line python, on the same OS, I can use acentuation >normally, without using unicodes or escape characters.
    [command line]
    a = 'andré'
    Can anybody help me?
    Perhaps the encoding set in control panel>keyboard>input locales>properties is
    not Portuguese?

    The code page for the console window is separately (I believe) controlled with
    the chcp command, which tells you the current code page number if you type chcp
    without specifying anything.

    Between that number and what you can see in your location for
    D:\Python23\Lib\encodings\aliases.py, maybe you can figure out why one works
    and the other doesn't.

    Caveat: I haven't changed my control panel keyboard settings, so I don't know
    if you have to reboot for it to take effect, or what else gets affected.

    Martin L?wis is the guru on encodings (among other things).
    Maurício Inforçati


    ------=_NextPart_000_01D4_01C360C9.9B611630
    Content-Type: text/html;
    charset="iso-8859-1"
    [...please don't post html if you can avoid it...]

    Regards,
    Bengt Richter

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedAug 12, '03 at 3:02p
activeAug 12, '03 at 7:24p
posts2
users2
websitepython.org

People

Translate

site design / logo © 2022 Grokbase