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

email.feedparser regex duplicate #46931

Closed
jimjjewett mannequin opened this issue Apr 24, 2008 · 3 comments
Closed

email.feedparser regex duplicate #46931

jimjjewett mannequin opened this issue Apr 24, 2008 · 3 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir topic-email

Comments

@jimjjewett
Copy link
Mannequin

jimjjewett mannequin commented Apr 24, 2008

BPO 2679
Nosy @ezio-melotti
Files
  • 2679.patch: Change in patch : NLCRE_crack = NLCRE_bol
  • 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 2008-04-24.13:52:19.311>
    labels = ['3.8', 'library', '3.9', '3.10']
    title = 'email.feedparser regex duplicate'
    updated_at = <Date 2020-10-25.23:24:50.146>
    user = 'https://bugs.python.org/jimjjewett'

    bugs.python.org fields:

    activity = <Date 2020-10-25.23:24:50.146>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2008-04-24.13:52:19.311>
    creator = 'jimjjewett'
    dependencies = []
    files = ['27132']
    hgrepos = []
    issue_num = 2679
    keywords = ['patch']
    message_count = 2.0
    messages = ['65723', '169904']
    nosy_count = 2.0
    nosy_names = ['jimjjewett', 'ezio.melotti']
    pr_nums = []
    priority = 'low'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue2679'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @jimjjewett
    Copy link
    Mannequin Author

    jimjjewett mannequin commented Apr 24, 2008

    feedparser defines four regexs for end-of-line, but two are redundant.

    NLCRE checks for the three common line endings.
    NLCRE_crack also captures the line ending.
    NLCRE_eol also adds a $ to ensure it is at the end.
    NLCRE_bol ... is identical to NLCRE_crack.

    It should either use a ^ to insist on line-start, or be explicitly the
    same. (e.g., NLCRE_bol=NLCRE_crack.) (It gets away with not listing the ^
    because the current code only uses NLCRE_bol.match.

    (Actually, if the regexes are considered private, then the current code
    could just use the bound methods directly ... setting NLCRE_bol to the
    .match method, NLCRE_eol to the .search method, and NLCRE_crack to the
    .split method.)

    @jimjjewett jimjjewett mannequin added the stdlib Python modules in the Lib dir label Apr 24, 2008
    @ezio-melotti ezio-melotti added the type-bug An unexpected behavior, bug, or error label Jan 12, 2010
    @moijes12
    Copy link
    Mannequin

    moijes12 mannequin commented Sep 6, 2012

    Hi

    I've attached a patch. Its a simple one wherein NLCRE_crack = NLCRE_bol. I found this in Python 3.3.0b2+ and so I've added version 3.3. I executed "./python -m test" after making the change and no failures were reported (340-OK, 30-Skip). Looking forward to your comments.

    @iritkatriel iritkatriel added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes and removed type-bug An unexpected behavior, bug, or error labels Oct 25, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @hugovk
    Copy link
    Member

    hugovk commented Feb 19, 2023

    I think we can close this issue: it's 15 years old, the patch is 10 years old. The patch is simple enough but no-one's been too bothered by the duplication in all this time.

    @hugovk hugovk closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir topic-email
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants