Skip to content

3.6 regression: re.compile not handling flags with X correctly #72257

Closed

Description

@yan12125
mannequin
BPO 28070
Nosy @ezio-melotti, @serhiy-storchaka, @yan12125

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 2016-09-10.22:44:20.690>
created_at = <Date 2016-09-10.22:07:45.732>
labels = ['expert-regex', 'type-bug', '3.7']
title = '3.6 regression: re.compile not handling flags with X correctly'
updated_at = <Date 2016-09-11.07:41:51.734>
user = 'https://github.com/yan12125'

bugs.python.org fields:

activity = <Date 2016-09-11.07:41:51.734>
actor = 'yan12125'
assignee = 'none'
closed = True
closed_date = <Date 2016-09-10.22:44:20.690>
closer = 'serhiy.storchaka'
components = ['Regular Expressions']
creation = <Date 2016-09-10.22:07:45.732>
creator = 'yan12125'
dependencies = []
files = []
hgrepos = []
issue_num = 28070
keywords = []
message_count = 5.0
messages = ['275705', '275706', '275708', '275709', '275738']
nosy_count = 6.0
nosy_names = ['ezio.melotti', 'mrabarnett', 'SilentGhost', 'python-dev', 'serhiy.storchaka', 'yan12125']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue28070'
versions = ['Python 3.6', 'Python 3.7']

Activity

  1. yan12125 commented on Sep 10, 2016

    yan12125mannequin
    MannequinAuthor

    This test script:

    import re

    print(re.compile(r'(?ix)A').flags == re.I | re.X | re.U)
    print(re.compile(r'(?ix)A').flags == re.X | re.U)
    print(re.compile(r'(?im)A').flags == re.I | re.M | re.U)

    gives False, True, True on default:b28b37de9470+. Python 3.5.2 gives True, False, True.

    Seems re.compile does not handle flags with X correctly?

  2. SilentGhost commented on Sep 10, 2016

    SilentGhostmannequin
    Mannequin

    I get normal behaviour on e3dbe8b7279a

  3. python-dev commented on Sep 10, 2016

    python-devmannequin
    Mannequin

    New changeset bee52e5f8fb1 by Serhiy Storchaka in branch 'default':
    Issue bpo-28070: Fixed parsing inline verbose flag in regular expressions.
    https://hg.python.org/cpython/rev/bee52e5f8fb1

    New changeset 842e75f0e592 by Serhiy Storchaka in branch '3.5':
    Backported tests for issue bpo-28070.
    https://hg.python.org/cpython/rev/842e75f0e592

    New changeset afc0d4478083 by Serhiy Storchaka in branch '2.7':
    Backported tests for issue bpo-28070.
    https://hg.python.org/cpython/rev/afc0d4478083

  4. serhiy-storchaka commented on Sep 10, 2016

    @serhiy-storchaka
    Member

    Thank you for your report Chi Hsuan Yen!

  5. yan12125 commented on Sep 11, 2016

    yan12125mannequin
    MannequinAuthor

    Thanks for such a quick fix!

  6. transferred this issue fromon Apr 10, 2022
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions