Skip to content

decoding_fgets() (tokenizer.c) decodes the filename from the wrong encoding #54987

Closed

Description

@vstinner
BPO 10778
Nosy @vstinner

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 = None
closed_at = <Date 2010-12-27.20:12:31.874>
created_at = <Date 2010-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 = <Date 2010-12-27.20:12:31.873>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2010-12-27.20:12:31.873>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2010-12-27.20:12:31.874>
closer = 'vstinner'
components = ['Interpreter Core', 'Unicode']
creation = <Date 2010-12-27.01:57:01.773>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 10778
keywords = []
message_count = 4.0
messages = ['124693', '124695', '124703', '124731']
nosy_count = 1.0
nosy_names = ['vstinner']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue10778'
versions = ['Python 3.2']

Activity

  1. vstinner commented on Dec 27, 2010

    @vstinner
    MemberAuthor

    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

  2. vstinner commented on Dec 27, 2010

    @vstinner
    MemberAuthor

    See also issue bpo-10779 (Change filename encoding to FS encoding in PyErr_WarnExplicit()).

  3. vstinner commented on Dec 27, 2010

    @vstinner
    MemberAuthor

    Oh, ignore "indenterror() (inconsistent use of tabs and spaces in indentation) and", I forgot to remove it. indenterror() is correct.

  4. vstinner commented on Dec 27, 2010

    @vstinner
    MemberAuthor

    Fixed by r87518.

  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions