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

Suppress expression chaining for RE parsing errors #91383

Closed
serhiy-storchaka opened this issue Apr 5, 2022 · 2 comments
Closed

Suppress expression chaining for RE parsing errors #91383

serhiy-storchaka opened this issue Apr 5, 2022 · 2 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir topic-regex type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 47227
Nosy @ezio-melotti, @serhiy-storchaka
PRs
  • bpo-47227: Suppress expression chaining for more RE parsing errors #32333
  • 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 2022-04-06.17:03:44.496>
    created_at = <Date 2022-04-05.12:41:51.928>
    labels = ['expert-regex', 'type-feature', 'library', '3.11']
    title = 'Suppress expression chaining for RE parsing errors'
    updated_at = <Date 2022-04-06.17:03:44.496>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2022-04-06.17:03:44.496>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-04-06.17:03:44.496>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)', 'Regular Expressions']
    creation = <Date 2022-04-05.12:41:51.928>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47227
    keywords = ['patch']
    message_count = 2.0
    messages = ['416774', '416885']
    nosy_count = 3.0
    nosy_names = ['ezio.melotti', 'mrabarnett', 'serhiy.storchaka']
    pr_nums = ['32333']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue47227'
    versions = ['Python 3.11']

    @serhiy-storchaka
    Copy link
    Member Author

    The EAFP principle is widely used in the regular expressions parsing code. Exceptions like KeyError, IndexError, ValueError or OverflowError raised during parsing are converted into a helpful re.error. Expression chaining is usually suppressed in such cases to hide unrelated implementation details, but not in all cases. The following PR adds more "from None" in "raise" statements inside "except" blocks.

    @serhiy-storchaka serhiy-storchaka added 3.11 only security fixes stdlib Python modules in the Lib dir topic-regex type-feature A feature request or enhancement labels Apr 5, 2022
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 50872db by Serhiy Storchaka in branch 'main':
    bpo-47227: Suppress expression chaining for more RE parsing errors (GH-32333)
    50872db

    @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.11 only security fixes stdlib Python modules in the Lib dir topic-regex type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant