classification
Title: Finish converting fixcid.py from regex to re
Type: behavior Stage: resolved
Components: Demos and Tools Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, ezio.melotti, martin.panter, python-dev, serhiy.storchaka, xiang.zhang
Priority: low Keywords: patch

Created on 2016-09-04 06:16 by serhiy.storchaka, last changed 2016-09-13 04:57 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
fixcid-re.patch martin.panter, 2016-09-09 10:06 review
fixcid-re.v2.patch martin.panter, 2016-09-10 03:28 review
Messages (8)
msg274341 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-09-04 06:16
Tools/scripts/fixcid.py initially used old regex module. In 4727f260f6f8 it was converted to using new re module, but not all generated regular expressions were converted to new syntax. The script is not working since that time.
msg275299 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-09-09 10:06
It would be nice to fix this so that the tests pass with -Werror. Here is a quick patch:

* Fix the deprecated non-escapes
* Make all the regular expressions raw strings
* Fix bugs with parsing escaped quotes in C strings and char literals
* Adapt from old regex module and Python 2 print statements
* Add a new test file with a single test case (could easily be expanded)

Documentation for the old “regex” module:
https://docs.python.org/release/1.6/lib/module-regex.html
msg275301 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-09-09 10:29
Thanks Martin. The patch in general LGTM, but see comments on Rietveld.
msg275556 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-09-10 03:28
New patch with more fixes and test cases. Also dropped some of the less useful raw string changes.
msg275764 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-11 10:07
New changeset 740e43eb8138 by Martin Panter in branch '2.7':
Issue #27952: Get fixcid.py working with the re module
https://hg.python.org/cpython/rev/740e43eb8138

New changeset ca68bb597df9 by Martin Panter in branch '3.5':
Issue #27952: Get fixcid.py working with the re module
https://hg.python.org/cpython/rev/ca68bb597df9

New changeset 8dde3dcab1e8 by Martin Panter in branch 'default':
Issue #27952: Merge fixcid.py from 3.5
https://hg.python.org/cpython/rev/8dde3dcab1e8
msg276159 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-09-13 04:13
Can we silence the debug output?

./python -m test  test_tools
Run tests sequentially
0:00:00 [1/1] test_tools
*recursedown('@test_20410_tmp')
1 test OK.

Total duration: 4 sec
Tests result: SUCCESS
msg276173 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-13 04:56
New changeset 5ae3782c4e05 by Berker Peksag in branch '3.5':
Issue #27952: Capture stderr in run_script()
https://hg.python.org/cpython/rev/5ae3782c4e05

New changeset 33d118a27035 by Berker Peksag in branch '3.6':
Issue #27952: Merge from 3.5
https://hg.python.org/cpython/rev/33d118a27035

New changeset 6acd2b575a3c by Berker Peksag in branch 'default':
Issue #27952: Merge from 3.6
https://hg.python.org/cpython/rev/6acd2b575a3c
msg276174 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-09-13 04:57
Done. I'm going to pretend 2.7 doesn't exist :)
History
Date User Action Args
2016-09-13 04:57:53berker.peksagsetstatus: open -> closed
nosy: + berker.peksag
messages: + msg276174

2016-09-13 04:56:06python-devsetmessages: + msg276173
2016-09-13 04:13:33xiang.zhangsetstatus: closed -> open
nosy: + xiang.zhang
messages: + msg276159

2016-09-11 12:09:11martin.pantersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-09-11 10:07:34python-devsetnosy: + python-dev
messages: + msg275764
2016-09-10 03:28:45martin.pantersetfiles: + fixcid-re.v2.patch

messages: + msg275556
2016-09-09 10:29:16serhiy.storchakasetmessages: + msg275301
2016-09-09 10:06:34martin.pantersetfiles: + fixcid-re.patch
keywords: + patch
messages: + msg275299

stage: needs patch -> patch review
2016-09-04 06:16:33serhiy.storchakacreate