Message204849
| Author |
deleted250130 |
| Recipients |
deleted250130 |
| Date |
2013年11月30日.21:40:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1385847645.21.0.327287028528.issue19846@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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) |
|
History
|
|---|
| 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 |
|