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

UTF-7 codec decodes ill-formed sequences starting with "+" #66792

Closed
jwilk mannequin opened this issue Oct 10, 2014 · 5 comments
Closed

UTF-7 codec decodes ill-formed sequences starting with "+" #66792

jwilk mannequin opened this issue Oct 10, 2014 · 5 comments
Labels
3.8 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode type-bug An unexpected behavior, bug, or error

Comments

@jwilk
Copy link
Mannequin

jwilk mannequin commented Oct 10, 2014

BPO 22602
Nosy @malemburg, @loewis, @vstinner, @jwilk, @ezio-melotti, @serhiy-storchaka, @ZackerySpytz
PRs
  • bpo-22602: Raise an exception in the UTF-7 decoder for ill-formed sequences starting with "+" #8741
  • 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 2018-08-19.04:44:28.301>
    created_at = <Date 2014-10-10.12:44:43.923>
    labels = ['interpreter-core', 'type-bug', '3.8', 'expert-unicode']
    title = 'UTF-7 codec decodes ill-formed sequences starting with "+"'
    updated_at = <Date 2018-08-19.04:44:28.300>
    user = 'https://github.com/jwilk'

    bugs.python.org fields:

    activity = <Date 2018-08-19.04:44:28.300>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-08-19.04:44:28.301>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core', 'Unicode']
    creation = <Date 2014-10-10.12:44:43.923>
    creator = 'jwilk'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 22602
    keywords = ['patch']
    message_count = 5.0
    messages = ['228996', '323431', '323444', '323742', '323743']
    nosy_count = 7.0
    nosy_names = ['lemburg', 'loewis', 'vstinner', 'jwilk', 'ezio.melotti', 'serhiy.storchaka', 'ZackerySpytz']
    pr_nums = ['8741']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue22602'
    versions = ['Python 3.8']

    @jwilk
    Copy link
    Mannequin Author

    jwilk mannequin commented Oct 10, 2014

    RFC 2152 reads:

    A "+" character followed immediately by any character other than
    members of set B or "-" is an ill-formed sequence.

    "@" is not a member of B, so I would expect this to raise UnicodeDecodeError:

    >>> b'+@'.decode('UTF-7')
    '@'

    @jwilk jwilk mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 10, 2014
    @serhiy-storchaka serhiy-storchaka added interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode and removed stdlib Python modules in the Lib dir labels Oct 10, 2014
    @ZackerySpytz
    Copy link
    Mannequin

    ZackerySpytz mannequin commented Aug 12, 2018

    This was also mentioned in bpo-24848.

    @ZackerySpytz ZackerySpytz mannequin added the 3.8 (EOL) end of life label Aug 12, 2018
    @serhiy-storchaka
    Copy link
    Member

    What about a "+" character followed immediately by the end of the bytestring?

    >>> b'+'.decode('utf-7')
    ''

    @serhiy-storchaka
    Copy link
    Member

    New changeset e349bf2 by Serhiy Storchaka (Zackery Spytz) in branch 'master':
    bpo-22602: Raise an exception in the UTF-7 decoder for ill-formed sequences starting with "+". (GH-8741)
    e349bf2

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your PR Zackery.

    @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.8 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant