You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
decoding_fgets() (tokenizer.c) decodes the filename from the wrong encoding #54987
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2010-12-27.20:12:31.874>created_at=<Date2010-12-27.01:57:01.773>labels= ['interpreter-core', 'expert-unicode']
title='decoding_fgets() (tokenizer.c) decodes the filename from the wrong encoding'updated_at=<Date2010-12-27.20:12:31.873>user='https://github.com/vstinner'
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
Activity
vstinner commentedon Dec 27, 2010
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
vstinner commentedon Dec 27, 2010
See also issue bpo-10779 (Change filename encoding to FS encoding in PyErr_WarnExplicit()).
vstinner commentedon Dec 27, 2010
Oh, ignore "indenterror() (inconsistent use of tabs and spaces in indentation) and", I forgot to remove it. indenterror() is correct.
vstinner commentedon Dec 27, 2010
Fixed by r87518.