This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: decoding_fgets() (tokenizer.c) decodes the filename from the wrong encoding
类型: Stage:
Components: Interpreter Core, Unicode Versions: Python 3.2
process
状态: closed Resolution: fixed
Dependencies: 后续:
分配给: 抄送列表: vstinner
优先级: normal 关键字:

Created on 2010-12-27 01:57 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg124693 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2010-12-27 01:57
decoding_fgets() decodes the input filename from UTF-8 whereas the filename is encoded to the filesystem encoding. PyUnicode_DecodeFSDefault() should be used.

decoding_fgets() raises a SyntaxError("Non-UTF-8 code starting with '\xHH' in file xxx on line xxx, but no encoding declared; ...").

indenterror() (inconsistent use of tabs and spaces in indentation) and
msg124695 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2010-12-27 02:06
See also issue #10779 (Change filename encoding to FS encoding in PyErr_WarnExplicit()).
msg124703 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2010-12-27 03:02
Oh, ignore "indenterror() (inconsistent use of tabs and spaces in indentation) and", I forgot to remove it. indenterror() is correct.
msg124731 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2010-12-27 20:12
Fixed by r87518.
历史
日期 用户 动作 参数
2022-04-11 14:57:10admin修改github: 54987
2010-12-27 20:12:31vstinner修改状态: open -> closed

消息: + msg124731
resolution: fixed
2010-12-27 03:02:40vstinner修改消息: + msg124703
2010-12-27 02:06:53vstinner修改消息: + msg124695
2010-12-27 01:57:01vstinner创建