aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-02-03 13:36:56 -0500
committerNick Mathewson <nickm@torproject.org>2020-02-03 13:36:56 -0500
commit5e963f97b1e70012e0917ce160b1579a87ab9bcb (patch)
treeb47791d50a8c9918701e384919aeef8494c0e4ab /scripts
parentec965ba98b8ad5b7aef8f5af68344c16e38ccd4d (diff)
downloadtor-5e963f97b1e70012e0917ce160b1579a87ab9bcb.tar.gz
tor-5e963f97b1e70012e0917ce160b1579a87ab9bcb.zip
practracker: use shutil.move so --regen will work on windows
On windows you can't os.rename() a file if the target filename already exists.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/practracker/practracker.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py
index 3f40f63c48..6149fb79cb 100755
--- a/scripts/maint/practracker/practracker.py
+++ b/scripts/maint/practracker/practracker.py
@@ -30,6 +30,7 @@ import metrics
import util
import problem
import includes
+import shutil
# The filename of the exceptions file (it should be placed in the practracker directory)
EXCEPTIONS_FNAME = "./exceptions.txt"
@@ -275,7 +276,7 @@ def main(argv):
if args.regen:
tmpfile.close()
- os.rename(tmpname, exceptions_file)
+ shutil.move(tmpname, exceptions_file)
sys.exit(0)
if args.regen_overbroad:
@@ -285,7 +286,7 @@ def main(argv):
for item in ProblemVault.list_exceptions_without_overbroad():
print(item, file=tmpfile)
tmpfile.close()
- os.rename(tmpname, exceptions_file)
+ shutil.move(tmpname, exceptions_file)
sys.exit(0)
# If new issues were found, try to give out some advice to the developer on how to resolve it.