
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-05-15 18:38 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| re_remove_deprecated.patch | serhiy.storchaka,2016-05-15 18:38 | review | ||
| re-sub-allow-unknown-escapes.patch | serhiy.storchaka,2016-12-06 10:25 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 552 | closed | dstufft,2017-03-31 16:36 | |
| Messages (16) | |||
|---|---|---|---|
| msg265641 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2016-05-15 18:38 | |
Proposed patch removes following deprecated re features:* Three unused not documented functions: isident(), isdigit() and isname(). They were deprecated since Python 3.3 (issue14462).* '\' + ASCII character now is error if this combination is not defined. This allows to add new control combinations without breaking compatibility. This was deprecated since Python 3.5 (issue23622).* Support for re.LOCALE with string patterns or with re.ASCII. This was deprecated since Python 3.5 (issue22407). | |||
| msg268222 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-06-11 16:15 | |
New changeset09d1af3fe332 by Serhiy Storchaka in branch 'default':Issue#27030: Unknown escapes consisting of ``'\'`` and ASCII letter inhttps://hg.python.org/cpython/rev/09d1af3fe332 | |||
| msg268223 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2016-06-11 16:16 | |
Thanks Jim for the review. | |||
| msg268224 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-06-11 16:24 | |
New changeset8ed3880e94e5 by Serhiy Storchaka in branch 'default':Issue#27030: The re.LOCALE flag now can be used only with bytes patterns.https://hg.python.org/cpython/rev/8ed3880e94e5 | |||
| msg268334 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-06-12 06:28 | |
New changeseta2482e805dff by Martin Panter in branch '3.5':Fix buggy RE “\parrot_example.py”, uncovered by Issue#27030https://hg.python.org/cpython/rev/a2482e805dffNew changesetbe193f8dbe4c by Martin Panter in branch 'default':Issue#27030: Merge RE fix from 3.5https://hg.python.org/cpython/rev/be193f8dbe4cNew changesetc5411cfa0bd3 by Martin Panter in branch '2.7':Fix buggy RE “\parrot_example.py”, uncovered by Issue#27030https://hg.python.org/cpython/rev/c5411cfa0bd3 | |||
| msg281485 -(view) | Author: Barry A. Warsaw (barry)*![]() | Date: 2016-11-22 14:41 | |
FWIW, this breaks Mailman 3.1 (and probably 2.1) | |||
| msg281487 -(view) | Author: Barry A. Warsaw (barry)*![]() | Date: 2016-11-22 14:42 | |
Specifically, point #2; undefined combinations of \ + ASCII becoming an error. | |||
| msg281491 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2016-11-22 16:13 | |
Could Mailman be fixed? Undefined combinations of \ + ASCII emitted warnings in 3.5. And now they emit warnings even just in string literals (issue27364). If Mailman use undefined escape combinations, it could suffer fromissue27364 too. | |||
| msg281496 -(view) | Author: Barry A. Warsaw (barry)*![]() | Date: 2016-11-22 18:19 | |
On Nov 22, 2016, at 04:13 PM, Serhiy Storchaka wrote:>Could Mailman be fixed? Undefined combinations of \ + ASCII emitted warnings>in 3.5. And now they emit warnings even just in string literals>(issue27364). If Mailman use undefined escape combinations, it could suffer>fromissue27364 too.No, I think this is a valid bug/regression.The Mailman code is basically trying to do this: p = re.compile('%\d*d') p.sub(r'\s*\d+\s*', some_string)And so we get the error:sre_constants.error: bad escape \s at position 0But this directly contradicts the documentation for re.sub():"... if it is a string, any backslash escapes in it are processed. That is, \nis converted to a single newline character, \r is converted to a carriagereturn, and so forth. Unknown escapes such as \& are left alone."Clearly \s is not being left alone, so this is a real regression. | |||
| msg281498 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2016-11-22 18:55 | |
This part of the documentation was just overlooked.Issue28450 is opened for this. | |||
| msg281503 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2016-11-22 19:34 | |
If you insist I could revert converting warnings to errors (only in replacement string or all?) in 3.6. But I think they should left errors in 3.7. The earlier we make undefined escapes the errors, the earlier we can define new special escape sequences without confusing users. It is bad if the escape sequence is valid in two Python versions but has different meaning. | |||
| msg281511 -(view) | Author: R. David Murray (r.david.murray)*![]() | Date: 2016-11-22 19:55 | |
There is still the argument that we shouldn't break 2.7 compatibility unnecessarily until 2.7 is out of maintenance. That is: warnings are good, removals are bad. (I haven't read through this issue, so I may be off base.) | |||
| msg282514 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2016-12-06 10:25 | |
Here is a patch that partially reverts changes ofissue27030. It allows using unknown escapes in re.sub() replacement template, but they are deprecated and will be errors in 3.7.If this is good to you Barry, and Ned allows, it can be committed in 3.6 only.But this could delay adding support of new escapes (like \xXX, \uXXXX, etc) in replacement templates. | |||
| msg282556 -(view) | Author: Ned Deily (ned.deily)*![]() | Date: 2016-12-06 16:56 | |
It is unfortunate that the deprecation note did not explicitly mention replacement templates as well as regexp patterns. While there are good arguments to be made for either case, I think it makes more sense to treat the replacement template as following the rules for strings rather than for regexps which would argue for making the proposed change to cause only a deprecation warning in templates for 3.6 - although I'm not happy about making such a change at the last minute. Serhiy, please push to 3.6 for rc1. There should also be a note in the What's New for 3.6 document. | |||
| msg282557 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-12-06 17:25 | |
New changeset1b162d6e3d01 by Serhiy Storchaka in branch '3.6':Issue#27030: Unknown escapes in re.sub() replacement template are allowedhttps://hg.python.org/cpython/rev/1b162d6e3d01New changeset5904d2ced3d8 by Serhiy Storchaka in branch 'default':Merge documentation for issue#27030 from 3.6.https://hg.python.org/cpython/rev/5904d2ced3d8 | |||
| msg282572 -(view) | Author: Ned Deily (ned.deily)*![]() | Date: 2016-12-06 22:26 | |
Thanks, Serhiy, for reverting the error handling for 3.6.0 (in 3.6.0rc1). I'm going to mark this as closed.Issue28450 is still open at the moment regarding the documentation and possible 3.7 changes. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:31 | admin | set | github: 71217 |
| 2017-03-31 16:36:29 | dstufft | set | pull_requests: +pull_request1021 |
| 2016-12-06 22:26:24 | ned.deily | set | status: open -> closed priority: release blocker -> versions: + Python 3.7 messages: +msg282572 resolution: fixed stage: commit review -> resolved |
| 2016-12-06 17:25:46 | python-dev | set | messages: +msg282557 |
| 2016-12-06 16:56:29 | ned.deily | set | assignee:ned.deily ->serhiy.storchaka messages: +msg282556 stage: patch review -> commit review |
| 2016-12-06 10:25:34 | serhiy.storchaka | set | status: closed -> open files: +re-sub-allow-unknown-escapes.patch assignee:serhiy.storchaka ->ned.deily resolution: fixed -> (no value) stage: resolved -> patch review messages: +msg282514 priority: normal -> release blocker |
| 2016-11-22 19:55:51 | r.david.murray | set | nosy: +r.david.murray messages: +msg281511 |
| 2016-11-22 19:34:29 | serhiy.storchaka | set | messages: +msg281503 |
| 2016-11-22 19:23:28 | barry | set | priority: release blocker -> normal status: open -> closed |
| 2016-11-22 18:55:47 | serhiy.storchaka | set | messages: +msg281498 |
| 2016-11-22 18:19:59 | barry | set | priority: normal -> release blocker status: closed -> open nosy: +ned.deily |
| 2016-11-22 18:19:23 | barry | set | messages: +msg281496 |
| 2016-11-22 16:13:07 | serhiy.storchaka | set | messages: +msg281491 |
| 2016-11-22 14:48:19 | pitrou | set | nosy: -pitrou |
| 2016-11-22 14:42:47 | barry | set | messages: +msg281487 |
| 2016-11-22 14:41:47 | barry | set | nosy: +barry messages: +msg281485 |
| 2016-06-12 06:28:46 | python-dev | set | messages: +msg268334 |
| 2016-06-11 16:24:49 | python-dev | set | messages: +msg268224 |
| 2016-06-11 16:16:31 | serhiy.storchaka | set | status: open -> closed messages: +msg268223 assignee:serhiy.storchaka resolution: fixed stage: patch review -> resolved |
| 2016-06-11 16:15:31 | python-dev | set | nosy: +python-dev messages: +msg268222 |
| 2016-05-15 18:38:16 | serhiy.storchaka | create | |