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

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

Closed
yan12125 mannequin opened this issue Sep 10, 2016 · 5 comments
Closed

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

yan12125 mannequin opened this issue Sep 10, 2016 · 5 comments
Labels
3.7 (EOL) end of life topic-regex type-bug An unexpected behavior, bug, or error

Comments

@yan12125
Copy link
Mannequin

yan12125 mannequin commented Sep 10, 2016

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']

@yan12125
Copy link
Mannequin Author

yan12125 mannequin commented Sep 10, 2016

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?

@yan12125 yan12125 mannequin added 3.7 (EOL) end of life topic-regex type-bug An unexpected behavior, bug, or error labels Sep 10, 2016
@SilentGhost
Copy link
Mannequin

SilentGhost mannequin commented Sep 10, 2016

I get normal behaviour on e3dbe8b7279a

@python-dev
Copy link
Mannequin

python-dev mannequin commented 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
Copy link
Member

Thank you for your report Chi Hsuan Yen!

@yan12125
Copy link
Mannequin Author

yan12125 mannequin commented Sep 11, 2016

Thanks for such a quick fix!

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life topic-regex type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant