Repository navigation
sre bug: lastmark_save/restore #53380
Description
Activity
The re module is buggy is rare cases; see attached example script.
The bug is caused by the macros LASTMARK_SAVE and LASTMARK_RESTORE which are sometimes used without the extra code that does if (state->repeat) {mark_save()/mark_restore()}.
The bug appears by mis-reporting the position of groups within a repeated match (with * or +), notably the position of some groups that matched in older repetitions but (after some backtracking) not in newer ones.
- addedextension-modulesC modules in the Modules dirC modules in the Modules dir
on Jun 30, 2010 - addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Jun 30, 2010 It's pretty trivial to turn my x.py into a unit test, of course.
It looks as the nature of this bug is clear to you, Armin. Do you want to write a patch?
It was clear to me four years ago. Now I'd have to dig again as much as you do.
Fixed in bpo-35859 together with other bugs, but the fix was only applied to 3.11, because that bug is old and the old behavior matches the behavior in some other engines (Perl and Java).
- added3.11only security fixesonly security fixesand removed3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life
on Mar 29, 2022
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:
bugs.python.org fields: