Message204849
It seems that print() and write() (and maybe other of such I/O functions) are relying on sys.getfilesystemencoding(). But these functions are not operating with filenames but with their content. In the attachments is an example script which demonstrates this problem. Here is what I get:
sworddragon@ubuntu:~/tmp$ echo $LANG
de_DE.UTF-8
sworddragon@ubuntu:~/tmp$ python3 test.py
sys.getdefaultencoding(): utf-8
sys.getfilesystemencoding(): utf-8
ä
sworddragon@ubuntu:~/tmp$ LANG=C
sworddragon@ubuntu:~/tmp$ python3 test.py
sys.getdefaultencoding(): utf-8
sys.getfilesystemencoding(): ascii
Traceback (most recent call last):
File "test.py", line 4, in <module>
print('\xe4')
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 0: ordinal not in range(128) |
|
Date |
User |
Action |
Args |
2013-11-30 21:40:45 | deleted250130 | set | recipients:
+ deleted250130 |
2013-11-30 21:40:45 | deleted250130 | set | messageid: <1385847645.21.0.327287028528.issue19846@psf.upfronthosting.co.za> |
2013-11-30 21:40:45 | deleted250130 | link | issue19846 messages |
2013-11-30 21:40:44 | deleted250130 | create | |
|