消息 [102996]
Python3 uses unicode surrogates to store undecodable filenames. Eg. the filename b"abc\xff.py" is encoded as "abc\xdcff.py" if the file system encoding is ASCII. Pickle is unable to store them:
./python -c 'import pickle; pickle.dumps("abc\udcff")'
(...)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 20: surrogates not allowed
This is a limitation of pickle (in the binary mode): Python accepts to store any unicode character, but pickle doesn't.
Using "surrogatepass" error handler should be enough to fix this issue.
Related issue: #3672 (Reject surrogates in utf-8 codec) -> r72208 creates "surrogatepass" error handler. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2010-04-13 00:39:57 | vstinner | 修改 | recipients:
+ vstinner, lemburg, loewis |
| 2010-04-13 00:39:57 | vstinner | 修改 | messageid: <1271119197.6.0.824303125234.issue8383@psf.upfronthosting.co.za> |
| 2010-04-13 00:39:55 | vstinner | 链接 | issue8383 messages |
| 2010-04-13 00:39:54 | vstinner | 创建 | |
|