GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — better name for re.error Exception class. · Issue #83162 · python/cpython

better name for re.error Exception class. #83162

New issue
Copy link
New issue
Copy link
Closed
Closed
better name for re.error Exception class.#83162
Copy link
Labels
3.13only security fixesonly security fixeseasytopic-regextype-featureA feature request or enhancementA feature request or enhancement

Description

Carreau
mannequin
opened on Dec 5, 2019
Issue body actions
BPO 38981
Nosy @gpshead, @ezio-melotti, @serhiy-storchaka, @Carreau, @Sourabh025
PRs
  • bpo-38981: Rename re.error to re.ReCompileError for better readability. #17501
  • 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 2019-12-05.16:56:07.880>
    labels = ['expert-regex', 'easy', 'type-feature', '3.9']
    title = 'better name for re.error Exception class.'
    updated_at = <Date 2020-09-18.07:39:36.123>
    user = 'https://github.com/Carreau'

    bugs.python.org fields:

    activity = <Date 2020-09-18.07:39:36.123>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Regular Expressions']
    creation = <Date 2019-12-05.16:56:07.880>
    creator = 'mbussonn'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38981
    keywords = ['patch', 'easy']
    message_count = 11.0
    messages = ['357867', '357878', '357882', '357883', '357884', '357886', '357962', '357982', '357986', '358059', '358124']
    nosy_count = 6.0
    nosy_names = ['gregory.p.smith', 'ezio.melotti', 'mrabarnett', 'serhiy.storchaka', 'mbussonn', 'sourabh025']
    pr_nums = ['17501']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue38981'
    versions = ['Python 3.9']

    Linked PRs

    • GH-83162: Rename re.error for better clarity. #101676
    • GH-83162: Rename re.error for better clarity. #101677
    • [3.12] gh-83162: Rename re.error in idlelib (GH-101677) #112987
    • [3.11] [3.12] gh-83162: Rename re.error in idlelib (GH-101677) (GH-112987) #113013

    Activity

    Next
    1. Carreau commented on Dec 5, 2019

      @Carreau
      Carreaumannequin
      on Dec 5, 2019
      MannequinAuthor
      More actions

      better error/exception name for re.compile error.

      Currently the error raise by re.compile when it fails to compile is error defined in sre_constants.py:

      class error(Exception):
          """Exception raised for invalid regular expressions.
      
      

      This is quite disturbing as most exception start with an uppercase and have a tiny bit more descriptive name.

      Would it be possible to have it renamed as something more explicit like ReCompileError, and still keeping the potential error alias as deprecated ?

    2. Carreau
      added
      topic-regex
      on Dec 5, 2019
    3. serhiy-storchaka commented on Dec 5, 2019

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 5, 2019
      Member
      More actions

      It is common practice that the module specific exception is called just "error". There is nothing wrong with this.

      I do not see a need to introduce a different alias.

    4. serhiy-storchaka
      closed this as completedon Dec 5, 2019
    5. serhiy-storchaka
      added
      invalid
      on Dec 5, 2019
    6. serhiy-storchaka commented on Dec 5, 2019

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 5, 2019
      Member
      More actions

      See also the discussion about renaming json.loads(): https://mail.python.org/archives/list/[email protected]/thread/EJTIVQ2ZFSVHALTLRGFCOMOYGZYMKGQU/

    7. Carreau commented on Dec 5, 2019

      @Carreau
      Carreaumannequin
      on Dec 5, 2019
      MannequinAuthor
      More actions

      Most of the module specific classes are Error, not error, at least with an uppercase E you know it's a class.

      if a novice sees :

      error: missing ), unterminated subpattern at position 0

      It will be relatively tough or them to figure out that error is the type of the exception.

      Also it's not because something works that you can't improve it ...

    8. Carreau
      reopened this on Dec 5, 2019
    9. serhiy-storchaka commented on Dec 5, 2019

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 5, 2019
      Member
      More actions

      Since it affects more than one module I suggest to discuss the idea about renaming exceptions of the Python-Ideas maillist first. Until different decision be made I am closing. Personally I think this is a duplicate of just discussed and rejected idea.

    10. serhiy-storchaka
      closed this as completedon Dec 5, 2019
    11. Carreau commented on Dec 5, 2019

      @Carreau
      Carreaumannequin
      on Dec 5, 2019
      MannequinAuthor
      More actions

      Thanks for the advice I've done that !

      Have a good day.

    12. serhiy-storchaka commented on Dec 7, 2019

      @serhiy-storchaka
      serhiy-storchaka
      on Dec 7, 2019
      Member
      More actions

      Reopened after discussing on Python-ideas: https://mail.python.org/archives/list/[email protected]/thread/64NHNY6RD4HQWBSBV6J7XIN7UAHNTQBR/.

    13. serhiy-storchaka
      added
      3.9 (EOL)end of lifeend of life
      type-featureA feature request or enhancementA feature request or enhancement
      on Dec 7, 2019
    14. serhiy-storchaka
      reopened this on Dec 7, 2019
    15. 32 remaining items

    16. achhina
      added a commit that references this issue on Jun 7, 2023

      Merge remote-tracking branch 'upstream/main' into pythonGH-83162

      b31d321
    17. achhina
      added 2 commits that reference this issue on Aug 27, 2023

      pythonGH-83162: Resolved merge conflicts.

      aac93f2

      Merge remote-tracking branch 'upstream/main' into pythonGH-83162

      b0d31d7
    18. achhina
      added 3 commits that reference this issue on Dec 3, 2023

      pythonGH-83162: Satisfy merge conflict.

      72480cf

      pythonGH-83162: Unwrap paragraph.

      1d3d472

      pythonGH-83162: Add space back in.

      f0a3cb0
    19. terryjreedy
      added a commit that references this issue on Dec 11, 2023

      GH-83162: Rename re.error for better clarity. (#101677)

      a01022a
    20. terryjreedy commented on Dec 12, 2023

      @terryjreedy
      terryjreedy
      on Dec 12, 2023
      Member
      More actions

      I merged the near-minimal PR with re.error 'updated' only in idlelib. I will do adjusted backports of the idlelib changes to keep the main bodies of its files in sync and then close.

      Reacted by achhina
    21. terryjreedy
      added 2 commits that reference this issue on Dec 12, 2023

      [3.12] pythongh-83162: Rename re.error in idlelib (python#101677)

      eb8848c

      [3.12] gh-83162: Rename re.error in idlelib (GH-101677) (#112987)

      fd3b894
    22. miss-islington
      added a commit that references this issue on Dec 12, 2023

      [3.12] pythongh-83162: Rename re.error in idlelib (pythonGH-101677) (p…

      4f64f42
    23. terryjreedy
      added a commit that references this issue on Dec 12, 2023

      [3.11] [3.12] gh-83162: Rename re.error in idlelib (GH-101677) (GH-11…

      11f9502
    24. terryjreedy
      closed this as completedon Dec 12, 2023
    25. aisk
      added a commit that references this issue on Feb 11, 2024

      pythonGH-83162: Rename re.error for better clarity. (python#101677)

      b4c175c
    26. Glyphack
      added a commit that references this issue on Sep 2, 2024

      pythonGH-83162: Rename re.error for better clarity. (python#101677)

      36e8f13
    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

      3.13only security fixesonly security fixeseasytopic-regextype-featureA feature request or enhancementA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402520 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.