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

pathfix.py does not find Python scripts that have '-' in its filename #82528

Closed
rpluem mannequin opened this issue Oct 2, 2019 · 9 comments
Closed

pathfix.py does not find Python scripts that have '-' in its filename #82528

rpluem mannequin opened this issue Oct 2, 2019 · 9 comments
Labels
3.9 only security fixes type-bug An unexpected behavior, bug, or error

Comments

@rpluem
Copy link
Mannequin

rpluem mannequin commented Oct 2, 2019

BPO 38347
Nosy @vstinner, @encukou, @miss-islington, @rpluem
PRs
  • bpo-38347: find Python scripts whose name contain a '-' #16536
  • [3.8] bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) #16718
  • [3.7] bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) #16719
  • 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 2019-10-11.15:37:39.873>
    created_at = <Date 2019-10-02.09:15:35.225>
    labels = ['type-bug', '3.9']
    title = "pathfix.py does not find Python scripts that have '-' in its filename"
    updated_at = <Date 2020-11-25.14:36:12.107>
    user = 'https://github.com/rpluem'

    bugs.python.org fields:

    activity = <Date 2020-11-25.14:36:12.107>
    actor = 'petr.viktorin'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-10-11.15:37:39.873>
    closer = 'vstinner'
    components = ['Demos and Tools']
    creation = <Date 2019-10-02.09:15:35.225>
    creator = 'rpluem'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38347
    keywords = ['patch']
    message_count = 9.0
    messages = ['353728', '354451', '354454', '354461', '354462', '354486', '354494', '354865', '381834']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'petr.viktorin', 'miss-islington', 'rpluem']
    pr_nums = ['16536', '16718', '16719']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue38347'
    versions = ['Python 3.9']

    @rpluem
    Copy link
    Mannequin Author

    rpluem mannequin commented Oct 2, 2019

    Tools/scripts/pathfix.py does not find Python scripts that contain a '-' in their filename when working recursively.
    This is caused by the regular expression used to detect whether a filename is a Python script:

    r'^[a-zA-Z0-9_]+\.py$'

    r'^[a-zA-Z0-9_-]+\.py$'

    fixes this. I am not sure if you want to allow further characters in script names like spaces or other special characters. The pull request I will create will only fix the '-' issue.

    @rpluem rpluem mannequin added 3.9 only security fixes type-bug An unexpected behavior, bug, or error labels Oct 2, 2019
    @vstinner
    Copy link
    Member

    New changeset 2b7dc40 by Victor Stinner (Ruediger Pluem) in branch 'master':
    bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
    2b7dc40

    @miss-islington
    Copy link
    Contributor

    New changeset 73665b4 by Miss Islington (bot) in branch '3.8':
    bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
    73665b4

    @vstinner
    Copy link
    Member

    New changeset ed189ce by Victor Stinner in branch '3.7':
    bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) (GH-16719)
    ed189ce

    @vstinner
    Copy link
    Member

    Thanks Ruediger Pluem: I merged your change into master and backported to 3.8 and 3.7. For the 3.7 backport, I skipped tests.

    @rpluem
    Copy link
    Mannequin Author

    rpluem mannequin commented Oct 11, 2019

    Welcome Victor Stinner. Any chance to get it also backported to 3.6 as I guess this would increase the chance to see it in RedHat 8 where I hit the issue?

    @vstinner
    Copy link
    Member

    Welcome Victor Stinner. Any chance to get it also backported to 3.6 as I guess this would increase the chance to see it in RedHat 8 where I hit the issue?

    Python 3.6 doesn't accept bugfixes upstream.

    If you are a Red Hat customer, you can contact the support to request a backport. Or you can copy the file from the master branch :-)

    @rpluem
    Copy link
    Mannequin Author

    rpluem mannequin commented Oct 18, 2019

    Thanks for the information. I opened a support request.

    @encukou
    Copy link
    Member

    encukou commented Nov 25, 2020

    Note that the pathfix comment says:

    # Directories are searched recursively for files whose name looks
    # like a python module.

    Files with a dash are *not* Python modules, since they can't be imported. Should the comment (which is the only documentation for pathfix, AFAIK) be updated to say it looks for the .py suffix?

    @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
    3.9 only security fixes type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants