Message312411
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. |
|
Date |
User |
Action |
Args |
2018-02-20 11:06:48 | hroncok | set | recipients:
+ hroncok |
2018-02-20 11:06:48 | hroncok | set | messageid: <1519124808.65.0.467229070634.issue32885@psf.upfronthosting.co.za> |
2018-02-20 11:06:48 | hroncok | link | issue32885 messages |
2018-02-20 11:06:48 | hroncok | create | |
|