You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
3.6 regression: re.compile not handling flags with X correctly #72257
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=Noneclosed_at=<Date2016-09-10.22:44:20.690>created_at=<Date2016-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=<Date2016-09-11.07:41:51.734>user='https://github.com/yan12125'
Activity
yan12125 commentedon Sep 10, 2016
This test script:
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?
SilentGhost commentedon Sep 10, 2016
I get normal behaviour on e3dbe8b7279a
python-dev commentedon Sep 10, 2016
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
serhiy-storchaka commentedon Sep 10, 2016
Thank you for your report Chi Hsuan Yen!
yan12125 commentedon Sep 11, 2016
Thanks for such a quick fix!