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

Tools/scripts/pathfix.py leaves bunch of ~ suffixed files around with no opt-out #77066

Closed
hroncok mannequin opened this issue Feb 20, 2018 · 7 comments
Closed

Tools/scripts/pathfix.py leaves bunch of ~ suffixed files around with no opt-out #77066

hroncok mannequin opened this issue Feb 20, 2018 · 7 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life type-bug An unexpected behavior, bug, or error

Comments

@hroncok
Copy link
Mannequin

hroncok mannequin commented Feb 20, 2018

BPO 32885
Nosy @tiran, @hroncok, @iritkatriel
PRs
  • bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ #5772
  • [3.7] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (GH-5772) #6103
  • [3.6] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (GH-5772) #6104
  • 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 2020-10-10.13:38:01.711>
    created_at = <Date 2018-02-20.11:06:48.607>
    labels = ['3.8', 'type-bug', '3.7']
    title = 'Tools/scripts/pathfix.py leaves bunch of ~ suffixed files around with no opt-out'
    updated_at = <Date 2020-10-10.13:38:01.711>
    user = 'https://github.com/hroncok'

    bugs.python.org fields:

    activity = <Date 2020-10-10.13:38:01.711>
    actor = 'hroncok'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-10.13:38:01.711>
    closer = 'hroncok'
    components = ['Demos and Tools']
    creation = <Date 2018-02-20.11:06:48.607>
    creator = 'hroncok'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32885
    keywords = ['patch']
    message_count = 7.0
    messages = ['312411', '312412', '313736', '313829', '313830', '378383', '378392']
    nosy_count = 3.0
    nosy_names = ['christian.heimes', 'hroncok', 'iritkatriel']
    pr_nums = ['5772', '6103', '6104']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32885'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    @hroncok
    Copy link
    Mannequin Author

    hroncok mannequin commented Feb 20, 2018

    We (Fedora's Python SIG) would like to promote usage of Tools/scripts/pathfix.py (we've even moved it to $PATH) in Fedora RPM build (a.k.a spec files) instead of various error prone finds + greps + seds.

    However when running pathfix.py, it creates backup files (with ~ suffix). This is mostly unfortunate in RPM build environment, because one needs to clean those up, otherwise one gets warnings and errors like this:

    error: Installed (but unpackaged) file(s) found:
    /usr/bin/spam~

    Or the file with ~ might even get installed if a more relaxed patter is used in a %files section that lists what is part of the RPM package.

    %{_bindir}/spam-*
    

    We even have shebangs checks/mangling in place and the ~ suffixed file still has the wrong shebang, resulting in warnings like this:

    *** WARNING: mangling shebang in /usr/bin/spam~ from #!/usr/bin/python -Es to #!/usr/bin/python2 -Es. This will become an ERROR, fix it manually!

    Steps to Reproduce:

    1. $ echo '#!python' > omg
    2. $ Tools/scripts/pathfix.py -i "/usr/bin/python3" -p omg # possibly with extra flag, see bellow
      omg: updating
    3. $ ls

    Actual results: omg omg~

    Expected results: omg

    Since the backup feature was here for ages, instead of changing the behavior, I suggest a flag is added that disables this. 2to3 has exactly the proposed flag as: "-n, --nobackups Don't write backups for modified files".

    This doesn't necessarily need to go into all versions, but I've selected all that has this problem. Getting it to 3.6+ would be great, however if it goes to anything later, we'll backport it in the Fedora package.

    I have a patch ready, sill send PR.

    @hroncok hroncok mannequin added 3.8 (EOL) end of life 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Feb 20, 2018
    @tiran
    Copy link
    Member

    tiran commented Feb 20, 2018

    It's technically a new feature. But since it's just in Tools/, we could make an exception. I've removed the security branches from versions.

    @tiran
    Copy link
    Member

    tiran commented Mar 13, 2018

    New changeset 5affd5c by Christian Heimes (Miro Hrončok) in branch 'master':
    bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (bpo-5772)
    5affd5c

    @tiran
    Copy link
    Member

    tiran commented Mar 14, 2018

    New changeset a954919 by Christian Heimes (Miss Islington (bot)) in branch '3.6':
    [3.6] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (GH-5772) (bpo-6104)
    a954919

    @tiran
    Copy link
    Member

    tiran commented Mar 14, 2018

    New changeset 6e65e44 by Christian Heimes (Miss Islington (bot)) in branch '3.7':
    [3.7] bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (GH-5772) (bpo-6103)
    6e65e44

    @iritkatriel
    Copy link
    Member

    This seems complete, can it be closed?

    @iritkatriel
    Copy link
    Member

    Please change status to closed as well. Thanks.

    @hroncok hroncok mannequin closed this as completed Oct 10, 2020
    @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.7 (EOL) end of life 3.8 (EOL) end of life type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants