This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 3.6 regression: re.compile not handling flags with X correctly
Type: behavior Stage: resolved
Components: Regular Expressions Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, ezio.melotti, mrabarnett, python-dev, serhiy.storchaka, yan12125
Priority: normal Keywords:

Created on 2016-09-10 22:07 by yan12125, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg275705 - (view) Author: (yan12125) * Date: 2016-09-10 22:07
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?
msg275706 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-09-10 22:17
I get normal behaviour on e3dbe8b7279a
msg275708 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-10 22:43
New changeset bee52e5f8fb1 by Serhiy Storchaka in branch 'default':
Issue #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 #28070.
https://hg.python.org/cpython/rev/842e75f0e592

New changeset afc0d4478083 by Serhiy Storchaka in branch '2.7':
Backported tests for issue #28070.
https://hg.python.org/cpython/rev/afc0d4478083
msg275709 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-09-10 22:44
Thank you for your report Chi Hsuan Yen!
msg275738 - (view) Author: (yan12125) * Date: 2016-09-11 07:41
Thanks for such a quick fix!
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72257
2016-09-11 07:41:51yan12125setmessages: + msg275738
2016-09-10 22:44:20serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg275709

stage: resolved
2016-09-10 22:43:36python-devsetnosy: + python-dev
messages: + msg275708
2016-09-10 22:17:05SilentGhostsetnosy: + SilentGhost
messages: + msg275706
2016-09-10 22:07:45yan12125create