Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error when parsing non-utf8 files #90212

Closed
pablogsal opened this issue Dec 12, 2021 · 5 comments
Closed

Incorrect error when parsing non-utf8 files #90212

pablogsal opened this issue Dec 12, 2021 · 5 comments
Labels
3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@pablogsal
Copy link
Member

BPO 46054
Nosy @lysnikolaou, @pablogsal, @miss-islington
PRs
  • bpo-46054: Fix parsing error when parsing non-utf8 characters in source files #30068
  • [3.10] bpo-46054: Fix parsing error when parsing non-utf8 characters in source files (GH-30068) #30069
  • bpo-46054: Correct non-utf8 character tests in test_exceptions #30074
  • 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 = None
    created_at = <Date 2021-12-12.05:29:47.894>
    labels = ['interpreter-core', '3.10', '3.11']
    title = 'Incorrect error when parsing non-utf8 files'
    updated_at = <Date 2021-12-12.16:53:04.865>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2021-12-12.16:53:04.865>
    actor = 'pablogsal'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Parser']
    creation = <Date 2021-12-12.05:29:47.894>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46054
    keywords = ['patch']
    message_count = 4.0
    messages = ['408361', '408366', '408398', '408399']
    nosy_count = 3.0
    nosy_names = ['lys.nikolaou', 'pablogsal', 'miss-islington']
    pr_nums = ['30068', '30069', '30074']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue46054'
    versions = ['Python 3.10', 'Python 3.11']

    @pablogsal
    Copy link
    Member Author

    Python3.9 shows:

    ../3.9/python /bin/ls
    SyntaxError: Non-UTF-8 code starting with '\xfc' in file /bin/ls on line 2, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for detail

    while 3.10 shows:

    python /bin/ls
    File "/bin/ls", line 0

    SyntaxError: unknown parsing error

    @pablogsal pablogsal added 3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Dec 12, 2021
    @pablogsal
    Copy link
    Member Author

    New changeset 4325a76 by Pablo Galindo Salgado in branch 'main':
    bpo-46054: Fix parsing error when parsing non-utf8 characters in source files (GH-30068)
    4325a76

    @pablogsal
    Copy link
    Member Author

    New changeset 94483f1 by Miss Islington (bot) in branch '3.10':
    bpo-46054: Fix parsing error when parsing non-utf8 characters in source files (GH-30068) (GH-30069)
    94483f1

    @pablogsal
    Copy link
    Member Author

    New changeset c6d1c52 by Pablo Galindo Salgado in branch 'main':
    bpo-46054: Correct non-utf8 character tests in test_exceptions (GH-30074)
    c6d1c52

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @lysnikolaou
    Copy link
    Contributor

    @pablogsal closing this, since 3.10-3.12 all raise the same expcted error:

    ❯ python3.10 /bin/ls
    SyntaxError: Non-UTF-8 code starting with '\x93' in file /bin/ls on line 2, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details
    ❯ python3.11 /bin/ls  
    SyntaxError: Non-UTF-8 code starting with '\x93' in file /bin/ls on line 2, but no encoding declared; see https://peps.python.org/pep-0263/ for details
    ❯ ./python /bin/ls
    SyntaxError: Non-UTF-8 code starting with '\x93' in file /bin/ls on line 2, but no encoding declared; see https://peps.python.org/pep-0263/ for details
    

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants