Skip to content
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

Finish converting fixcid.py from regex to re #72139

Closed
serhiy-storchaka opened this issue Sep 4, 2016 · 8 comments
Closed

Finish converting fixcid.py from regex to re #72139

serhiy-storchaka opened this issue Sep 4, 2016 · 8 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 27952
Nosy @ezio-melotti, @berkerpeksag, @vadmium, @serhiy-storchaka, @zhangyangyu
Files
  • fixcid-re.patch
  • fixcid-re.v2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-09-13.04:57:53.238>
    created_at = <Date 2016-09-04.06:16:33.397>
    labels = ['type-bug']
    title = 'Finish converting fixcid.py from regex to re'
    updated_at = <Date 2016-09-13.04:57:53.236>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2016-09-13.04:57:53.236>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-09-13.04:57:53.238>
    closer = 'berker.peksag'
    components = ['Demos and Tools']
    creation = <Date 2016-09-04.06:16:33.397>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['44496', '44521']
    hgrepos = []
    issue_num = 27952
    keywords = ['patch']
    message_count = 8.0
    messages = ['274341', '275299', '275301', '275556', '275764', '276159', '276173', '276174']
    nosy_count = 6.0
    nosy_names = ['ezio.melotti', 'python-dev', 'berker.peksag', 'martin.panter', 'serhiy.storchaka', 'xiang.zhang']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27952'
    versions = ['Python 2.7', 'Python 3.5', 'Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Sep 4, 2016
    @vadmium
    Copy link
    Member

    vadmium commented Sep 9, 2016

    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

    @serhiy-storchaka
    Copy link
    Member Author

    Thanks Martin. The patch in general LGTM, but see comments on Rietveld.

    @vadmium
    Copy link
    Member

    vadmium commented Sep 10, 2016

    New patch with more fixes and test cases. Also dropped some of the less useful raw string changes.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 11, 2016

    New changeset 740e43eb8138 by Martin Panter in branch '2.7':
    Issue bpo-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 bpo-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 bpo-27952: Merge fixcid.py from 3.5
    https://hg.python.org/cpython/rev/8dde3dcab1e8

    @vadmium vadmium closed this as completed Sep 11, 2016
    @zhangyangyu
    Copy link
    Member

    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

    @zhangyangyu zhangyangyu reopened this Sep 13, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 13, 2016

    New changeset 5ae3782c4e05 by Berker Peksag in branch '3.5':
    Issue bpo-27952: Capture stderr in run_script()
    https://hg.python.org/cpython/rev/5ae3782c4e05

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

    New changeset 6acd2b575a3c by Berker Peksag in branch 'default':
    Issue bpo-27952: Merge from 3.6
    https://hg.python.org/cpython/rev/6acd2b575a3c

    @berkerpeksag
    Copy link
    Member

    Done. I'm going to pretend 2.7 doesn't exist :)

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants