Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(685)

#22493: Deprecate the use of flags not at the start of regular expression

Can't Edit
Can't Publish+Mail
Start Review
Created:
3 years ago by storchaka+cpython
Modified:
1 year, 1 month ago
Reviewers:
pitrou, timograham
CC:
AntoinePitrou, ezio.melotti, mrabarnett, devnull_psf.upfronthosting.co.za, storchaka, Tim.Graham
Visibility:
Public.

Patch Set 1 #

Total comments: 2

Patch Set 2 #

Patch Set 3 #

Patch Set 4 #

Total comments: 1

Patch Set 5 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/sre_parse.py View 1 2 3 4 1 chunk +7 lines, -2 lines 0 comments Download
Lib/test/test_re.py View 1 2 3 4 1 chunk +12 lines, -1 line 0 comments Download

Messages

Total messages: 4
AntoinePitrou
I'm not sure how desirable this is. You had to modify a bunch of tests, ...
3 years ago #1
storchaka_gmail.com
http://bugs.python.org/review/22493/diff/12926/Lib/http/cookies.py File Lib/http/cookies.py (left): http://bugs.python.org/review/22493/diff/12926/Lib/http/cookies.py#oldcode433 Lib/http/cookies.py:433: (?x) # This is a verbose pattern On 2014/10/08 ...
3 years ago #2
storchaka
http://bugs.python.org/review/22493/diff/18565/Lib/test/test_re.py File Lib/test/test_re.py (right): http://bugs.python.org/review/22493/diff/18565/Lib/test/test_re.py#newcode1326 Lib/test/test_re.py:1326: msg = 'Flags not at the start of the ...
1 year, 1 month ago #3
Tim.Graham
1 year, 1 month ago #4
On 2016/09/15 22:48:01, storchaka wrote:
> http://bugs.python.org/review/22493/diff/18565/Lib/test/test_re.py
> File Lib/test/test_re.py (right):
> 
> http://bugs.python.org/review/22493/diff/18565/Lib/test/test_re.py#newcode1326
> Lib/test/test_re.py:1326: msg = 'Flags not at the start of the expression
(?i)'
> This is self-descriptive regex! It contains a flag (?i) not at the start.
> 
> The second argument of assertWarnsRegex() is not a literal string, it is a
> regular expression. Special symbols in msg should be escaped.

Is it fine to add re.escape() around the string?
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7