Don't use undocumented re.template()#1827
Don't use undocumented re.template()#1827m-blaha merged 2 commits intorpm-software-management:masterfrom
Conversation
Python 3.11.0b1 removed it: python/cpython@b09184bf05 It might be resurrected for a proper deprecation period, but it is going away. See python/cpython#92728 I've looked at the original commit that introduced this code: 6707f47 There is no clear indication that would suggest why re.template was used.
vstinner
left a comment
There was a problem hiding this comment.
LGTM. dnf uses escape(needle), the regex cannot use backtracking, and so re.template() can be safely replaced with re.compile().
|
BTW I could actually use |
|
re.sub() calls re.compile() internally ;-) The change LGTM. |
|
To be honest I have absolutely no idea what is |
Nobody does. That's why it is being removed from Python. |
|
:) |
|
Do I need to open a bugzilla to get this backported to rawhide in the next ~1 month? |
|
There should be new release by that time. But just to be sure and not to forget, I've backported your patch to rawhide right now. So no need for a bugzilla. |
|
🙇 EDIT: This was meant as a thank you, but I've been told that it can mean to apologize, so calrifying. |
Python 3.11.0b1 removed it: python/cpython@b09184bf05
It might be resurrected for a proper deprecation period, but it is going away.
See python/cpython#92728
I've looked at the original commit that introduced this code: 6707f47
There is no clear indication that would suggest why re.template was used.