A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-September/121572.html below:

[Python-Dev] Unicode support of the curses module in Python 3.3

[Python-Dev] Unicode support of the curses module in Python 3.3 [Python-Dev] Unicode support of the curses module in Python 3.3Victor Stinner victor.stinner at gmail.com
Sun Sep 2 12:44:47 CEST 2012
>> For example, if the Python curses module is not linked to libncursesw,
>> get_wch() is not available and addch("é") raises an OverflowError if
>> the locale encoding is UTF-8 (because "é".encode("utf-8") is longer
>> than 1 byte).
>
> OverflowError? That is very surprising. I wouldn't guess that calling
> addch could raise OverflowError.
>
> Could you use a less surprising exception, or at least make sure that
> it is clearly and obviously documented?

Which exception would you expect? ValueError? Another error?

I used the same exception for addch(int) and addch(str). addch(int)
already raises an OverflowError on Python 3.2 if the value doesn't fit
in a C long type (which may be bigger than chtype, Python 3.3 is more
strict), so applications don't need to be changed for the "new" error
(on addch(str)).

Victor
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4