mirror of https://github.com/mahmoud/boltons.git
fileutils.replace: bak file for win32 ReplaceFile for slightly better corner case coverage on less featureful filesystems
This commit is contained in:
parent
8899811905
commit
225d98f68f
|
@ -258,8 +258,9 @@ if os.name == 'nt':
|
||||||
|
|
||||||
src = path_to_unicode(src)
|
src = path_to_unicode(src)
|
||||||
dst = path_to_unicode(dst)
|
dst = path_to_unicode(dst)
|
||||||
res = _ReplaceFile(c_wchar_p(dst), c_wchar_p(src),
|
bak = dst + u'.bak'
|
||||||
None, 0, None, None)
|
res = _ReplaceFile(c_wchar_p(dst), c_wchar_p(src), c_wchar_p(bak),
|
||||||
|
0, None, None)
|
||||||
if not res:
|
if not res:
|
||||||
raise OSError('failed to replace %r with %r' % (dst, src))
|
raise OSError('failed to replace %r with %r' % (dst, src))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue