Message9317
> Also this problem goes away more or less with Jython 3.
CPython 3 still has sys.getfilesystemencoding() and losslessly (i.e. without REPLACEMENT CHARACTERs) supports bytes paths...
$ rm -fr /tmp/some_dir
$ mkdir /tmp/some_dir
$ touch /tmp/some_dir/ś
$ touch /tmp/some_dir/$'\x80'
$ touch /tmp/some_dir/aaa$'\x80\x81\x82\x83'aaa
$ python3.5 -c 'import os; print(os.listdir(b"/tmp/some_dir"))'
[b'aaa\x80\x81\x82\x83aaa', b'\xc5\x9b', b'\x80']
$ python3.5 -c 'import os; print(os.listdir("/tmp/some_dir"))'
['aaa\udc80\udc81\udc82\udc83aaa', 'ś', '\udc80']
$ LC_ALL="C" python3.5 -c 'import os; print(os.listdir("/tmp/some_dir"))'
['aaa\udc80\udc81\udc82\udc83aaa', '\udcc5\udc9b', '\udc80']
$ python3.5 -c 'import sys; print(sys.getfilesystemencoding())'
utf-8
$ LC_ALL="C" python3.5 -c 'import sys; print(sys.getfilesystemencoding())'
ascii |
|
Date |
User |
Action |
Args |
2015-01-06 19:09:02 | Arfrever | set | messageid: <1420571342.72.0.465914086051.issue1839@psf.upfronthosting.co.za> |
2015-01-06 19:09:02 | Arfrever | set | recipients:
+ Arfrever, fwierzbicki, amak, pekka.klarck, zyasoft |
2015-01-06 19:09:02 | Arfrever | link | issue1839 messages |
2015-01-06 19:09:02 | Arfrever | create | |
|