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

#25953: re fails to identify invalid numeric group references in replacement strings

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 9 months ago by bazwal
Modified:
12 months ago
Reviewers:
storchaka+cpython, ghost.adh
CC:
bazwal_gmail.com, ezio.melotti, mrabarnett, SilentGhost, devnull_psf.upfronthosting.co.za, storchaka
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 1

Patch Set 3 #

Total comments: 7

Patch Set 4 #

Total comments: 6

Patch Set 5 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/sre_parse.py View 1 2 3 4 5 chunks +9 lines, -7 lines 0 comments Download
Lib/test/test_re.py View 1 2 3 4 4 chunks +20 lines, -19 lines 0 comments Download

Messages

Total messages: 6
storchaka
http://bugs.python.org/review/25953/diff/18873/Lib/sre_parse.py File Lib/sre_parse.py (right): http://bugs.python.org/review/25953/diff/18873/Lib/sre_parse.py#newcode888 Lib/sre_parse.py:888: raise error("invalid group reference %r" % index) It would ...
1 year ago #1
storchaka
http://bugs.python.org/review/25953/diff/18912/Lib/sre_parse.py File Lib/sre_parse.py (right): http://bugs.python.org/review/25953/diff/18912/Lib/sre_parse.py#newcode888 Lib/sre_parse.py:888: raise s.error("invalid group reference %r" % index) The position ...
12 months ago #2
SilentGhost
https://bugs.python.org/review/25953/diff/18912/Lib/test/test_re.py File Lib/test/test_re.py (right): https://bugs.python.org/review/25953/diff/18912/Lib/test/test_re.py#newcode563 Lib/test/test_re.py:563: self.checkTemplateError('()', r'\g<%s>' % sre_constants.MAXGROUPS, 'xx', On 2016/10/20 22:44:57, storchaka ...
12 months ago #3
storchaka
https://bugs.python.org/review/25953/diff/18937/Lib/sre_parse.py File Lib/sre_parse.py (right): https://bugs.python.org/review/25953/diff/18937/Lib/sre_parse.py#newcode728 Lib/sre_parse.py:728: raise source.error("invalid group reference %r" % condgroup, The line ...
12 months ago #4
SilentGhost
https://bugs.python.org/review/25953/diff/18937/Lib/test/test_re.py File Lib/test/test_re.py (right): https://bugs.python.org/review/25953/diff/18937/Lib/test/test_re.py#newcode277 Lib/test/test_re.py:277: 'invalid group reference 2', 2) On 2016/10/22 14:37:00, storchaka ...
12 months ago #5
storchaka
12 months ago #6
https://bugs.python.org/review/25953/diff/18937/Lib/test/test_re.py
File Lib/test/test_re.py (right):

https://bugs.python.org/review/25953/diff/18937/Lib/test/test_re.py#newcode277
Lib/test/test_re.py:277: 'invalid group reference 2', 2)
On 2016/10/22 15:04:59, SilentGhost wrote:
> On 2016/10/22 14:37:00, storchaka wrote:
> > The position is wrong. It should point at the start of group name/index
> (compare
> > with above tests), i.e. be equal to 1 here.
> The above tests (lines 189-201) have position equal 2. Is that also not
correct
> there?
Yes, they are not correct too.

> Or are you referring to the lines 263-275? (but then I'm not sure why
> they'd be relevant here).
Tests at lines 263-275 have correct positions. Invalid group reference 2 starts
at position 3 in pattern r'\g<2>' and at position 1 in pattern r'\2'.
Sign in to reply to this message.

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