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

Fix incremental decoder and stream reader in the "raw-unicode-escape" codec #89630

Closed
serhiy-storchaka opened this issue Oct 14, 2021 · 5 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes topic-unicode type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 45467
Nosy @malemburg, @vstinner, @ezio-melotti, @serhiy-storchaka
PRs
  • bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec #28944
  • [3.10] bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw… #28952
  • [3.9] bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicod… #28953
  • Dependencies
  • bpo-45461: UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string
  • 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 2021-10-14.19:17:23.992>
    created_at = <Date 2021-10-14.10:29:46.781>
    labels = ['3.10', 'type-bug', '3.9', 'expert-unicode', '3.11']
    title = 'Fix incremental decoder and stream reader in the "raw-unicode-escape" codec'
    updated_at = <Date 2021-10-14.19:17:23.992>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2021-10-14.19:17:23.992>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-14.19:17:23.992>
    closer = 'serhiy.storchaka'
    components = ['Unicode']
    creation = <Date 2021-10-14.10:29:46.781>
    creator = 'serhiy.storchaka'
    dependencies = ['45461']
    files = []
    hgrepos = []
    issue_num = 45467
    keywords = ['patch']
    message_count = 5.0
    messages = ['403893', '403921', '403927', '403928', '403935']
    nosy_count = 4.0
    nosy_names = ['lemburg', 'vstinner', 'ezio.melotti', 'serhiy.storchaka']
    pr_nums = ['28944', '28952', '28953']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue45467'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @serhiy-storchaka
    Copy link
    Member Author

    Similar to 45461, but with "raw-unicode-escape".

    When an incremental decoder gets a part of escape sequence (\uXXXX or \UXXXXXXXX) it raises an exception or return a bare "\" if it was the only part instead of keeping it until getting the rest. It is exposed in text files (io.TextIOWrapper) when reads from the underlying binary stream splits an escape sequence between blocks. There is similar issue with stream readers (codecs.StreamReader).

    @serhiy-storchaka serhiy-storchaka added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes topic-unicode type-bug An unexpected behavior, bug, or error labels Oct 14, 2021
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 39aa983 by Serhiy Storchaka in branch 'main':
    bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944)
    39aa983

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 4641afe by Serhiy Storchaka in branch '3.10':
    [3.10] bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944) (GH-28952)
    4641afe

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 6848602 by Serhiy Storchaka in branch '3.9':
    bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944) (GH-28953)
    6848602

    @vstinner
    Copy link
    Member

    Serhiy: I suppose that this issue can now be closed?

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes topic-unicode type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants