mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-91616: re module, fix .fullmatch() mismatch when using Atomic Grouping or Possessive Quantifiers (GH-91681)
These jumps should use DO_JUMP0() instead of DO_JUMP(): - JUMP_POSS_REPEAT_1 - JUMP_POSS_REPEAT_2 - JUMP_ATOMIC_GROUP
This commit is contained in:
parent
061a8bf77c
commit
e4e8895ae3
4 changed files with 37 additions and 8 deletions
|
@ -1388,6 +1388,7 @@ class _BasePathTest(object):
|
|||
# | |-- dirD
|
||||
# | | `-- fileD
|
||||
# | `-- fileC
|
||||
# | `-- novel.txt
|
||||
# |-- dirE # No permissions
|
||||
# |-- fileA
|
||||
# |-- linkA -> fileA
|
||||
|
@ -1412,6 +1413,8 @@ class _BasePathTest(object):
|
|||
f.write(b"this is file B\n")
|
||||
with open(join('dirC', 'fileC'), 'wb') as f:
|
||||
f.write(b"this is file C\n")
|
||||
with open(join('dirC', 'novel.txt'), 'wb') as f:
|
||||
f.write(b"this is a novel\n")
|
||||
with open(join('dirC', 'dirD', 'fileD'), 'wb') as f:
|
||||
f.write(b"this is file D\n")
|
||||
os.chmod(join('dirE'), 0)
|
||||
|
@ -1679,6 +1682,9 @@ class _BasePathTest(object):
|
|||
p = P(BASE, "dirC")
|
||||
_check(p.rglob("file*"), ["dirC/fileC", "dirC/dirD/fileD"])
|
||||
_check(p.rglob("*/*"), ["dirC/dirD/fileD"])
|
||||
# gh-91616, a re module regression
|
||||
_check(p.rglob("*.txt"), ["dirC/novel.txt"])
|
||||
_check(p.rglob("*.*"), ["dirC/novel.txt"])
|
||||
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_rglob_symlink_loop(self):
|
||||
|
@ -1689,7 +1695,8 @@ class _BasePathTest(object):
|
|||
expect = {'brokenLink',
|
||||
'dirA', 'dirA/linkC',
|
||||
'dirB', 'dirB/fileB', 'dirB/linkD',
|
||||
'dirC', 'dirC/dirD', 'dirC/dirD/fileD', 'dirC/fileC',
|
||||
'dirC', 'dirC/dirD', 'dirC/dirD/fileD',
|
||||
'dirC/fileC', 'dirC/novel.txt',
|
||||
'dirE',
|
||||
'fileA',
|
||||
'linkA',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue