Message74280
@loewis: I guess that your locale is still UTF-8.
On Linux (Ubuntu Gutsy) using "env -i DISPLAY=$DISPLAY HOME=$HOME
xterm" to get a new empty environment, I get:
$ locale
LANG=
LC_ALL=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
...
$ python3.0
>>> from idlelib.IOBinding import encoding
>>> encoding
'ansi_x3.4-1968'
>>> import locale
>>> locale.getdefaultlocale()
(None, None)
>>> locale.nl_langinfo(locale.CODESET)
'ANSI_X3.4-1968'
In this environment, IDLE is unable to detect
idle-3.0rc1-quits-when-run.py encoding.
IDLE uses open(filename, 'r'): it doesn't specify the charset. In this
case, TextIOWrapper uses locale.getpreferredencoding() as encoding (or
ASCII on failure).
To sum IDLE: if your locale is UTF-8, you will be able to open an
UTF-8 file. So for example, if your locale is UTF-8, you won't be able
to open an ISO-8859-1 file. Let's try iso.py: IDLE displays the
error "Failed to decode" and quit whereas I specified the encoding :-/ |
|
Date |
User |
Action |
Args |
2008-10-03 22:37:13 | vstinner | set | recipients:
+ vstinner, loewis |
2008-10-03 22:37:13 | vstinner | set | messageid: <1223073433.74.0.13349664868.issue4008@psf.upfronthosting.co.za> |
2008-10-03 22:37:12 | vstinner | link | issue4008 messages |
2008-10-03 22:37:11 | vstinner | create | |
|