-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Internal error when compile RE with conditional expression referring to not defined group #91700
Comments
serhiy-storchaka
added
type-bug
An unexpected behavior, bug, or error
stdlib
Python modules in the Lib dir
topic-regex
3.11
only security fixes
3.10
only security fixes
3.9
only security fixes
labels
Apr 19, 2022
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Apr 19, 2022
…n RE In expression (?(group)...) an appropriate re.error is now raised if the group number refers to not defined group. Previously it raised RuntimeError: invalid SRE code.
serhiy-storchaka
added a commit
that referenced
this issue
Apr 22, 2022
…H-91702) In expression (?(group)...) an appropriate re.error is now raised if the group number refers to not defined group. Previously it raised RuntimeError: invalid SRE code.
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Apr 22, 2022
…ssion in RE (pythonGH-91702) In expression (?(group)...) an appropriate re.error is now raised if the group number refers to not defined group. Previously it raised RuntimeError: invalid SRE code.. (cherry picked from commit 48ec61a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Apr 22, 2022
…ssion in RE (pythonGH-91702) (pythonGH-91831) In expression (?(group)...) an appropriate re.error is now raised if the group number refers to not defined group. Previously it raised RuntimeError: invalid SRE code. (cherry picked from commit 48ec61a) (cherry picked from commit 080781c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka
added a commit
that referenced
this issue
Apr 22, 2022
…n RE (GH-91702) (GH-91831) (GH-91836) In expression (?(group)...) an appropriate re.error is now raised if the group number refers to not defined group. Previously it raised RuntimeError: invalid SRE code. (cherry picked from commit 48ec61a) (cherry picked from commit 080781c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
hello-adam
pushed a commit
to hello-adam/cpython
that referenced
this issue
Jun 2, 2022
…sion in RE (pythonGH-91702) (pythonGH-91831) (pythonGH-91836) In expression (?(group)...) an appropriate re.error is now raised if the group number refers to not defined group. Previously it raised RuntimeError: invalid SRE code. (cherry picked from commit 48ec61a) (cherry picked from commit 080781c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When compile a regular expression with conditional expression which refers to not defined group (i.e. refers by group number which larger than the number of captured groups) you get an internal error:
Referring to groups which are defined after the conditional expression is allowed. There are special tests for this. It means that we cannot just compare the reference number with the number of groups defined before it.
The text was updated successfully, but these errors were encountered: