projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13e8c3b
)
fileutil: make the error behaviour of replace_file on Unix more similar to Windows.
author
Daira Hopwood
<daira@jacaranda.org>
Tue, 2 Jun 2015 01:09:25 +0000
(
02:09
+0100)
committer
Daira Hopwood
<daira@jacaranda.org>
Wed, 30 Sep 2015 15:45:21 +0000
(16:45 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/util/fileutil.py
patch
|
blob
|
history
diff --git
a/src/allmydata/util/fileutil.py
b/src/allmydata/util/fileutil.py
index 26943212bde4b6870e96e825a39b572992af4885..133d22710e653dded221b668f30ec2062d9d3e3a 100644
(file)
--- a/
src/allmydata/util/fileutil.py
+++ b/
src/allmydata/util/fileutil.py
@@
-615,6
+615,8
@@
else:
precondition_abspath(replacement_path)
precondition_abspath(backup_path)
+ if not os.path.exists(replacement_path):
+ raise ConflictError("Replacement file not found: %r" % (replacement_path,))
try:
os.rename(replaced_path, backup_path)
rename_no_overwrite(replacement_path, replaced_path)