-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Internal error when compile RE with conditional expression referring to not defined group #91700
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
Comments
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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: