Skip to content

bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~#5772

Merged
tiran merged 1 commit into
python:masterfrom
hroncok:pathfix-nobackup
Mar 13, 2018
Merged

bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~#5772
tiran merged 1 commit into
python:masterfrom
hroncok:pathfix-nobackup

Conversation

@hroncok

@hroncok hroncok commented Feb 20, 2018

Copy link
Copy Markdown
Contributor

Creating backup files with ~ suffix can be undesirable in some environment, such as when building RPM packages. Instead of requiring the user to remove those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.

https://bugs.python.org/issue32885

Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
Comment thread Tools/scripts/pathfix.py
err('%s: warning: backup failed (%r)\n' % (filename, msg))
else:
try:
os.remove(filename)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, os.remove() is required for Windows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly what i thought of when I read the docs for os.move that comes later. Should I explain this in comment?

@hroncok

hroncok commented Feb 20, 2018

Copy link
Copy Markdown
Contributor Author

@tiran thanks for swift approval.

@tiran tiran merged commit 5affd5c into python:master Mar 13, 2018
@bedevere-bot

Copy link
Copy Markdown

@tiran: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @hroncok for the PR, and @tiran for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

@bedevere-bot

Copy link
Copy Markdown

GH-6103 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 13, 2018
…thonGH-5772)

Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
(cherry picked from commit 5affd5c)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 13, 2018
…thonGH-5772)

Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
(cherry picked from commit 5affd5c)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@bedevere-bot

Copy link
Copy Markdown

GH-6104 is a backport of this pull request to the 3.6 branch.

tiran pushed a commit that referenced this pull request Mar 14, 2018
…p~ (GH-5772) (#6104)

Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
(cherry picked from commit 5affd5c)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
tiran pushed a commit that referenced this pull request Mar 14, 2018
…p~ (GH-5772) (#6103)

Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
(cherry picked from commit 5affd5c)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@hroncok hroncok deleted the pathfix-nobackup branch March 14, 2018 20:53
jo2y pushed a commit to jo2y/cpython that referenced this pull request Mar 23, 2018
…thon#5772)

Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants