mirror of
https://github.com/arsenetar/send2trash.git
synced 2025-05-08 09:49:52 +00:00
shutil.move instead of os.rename
This commit is contained in:
parent
66afce7252
commit
b7ca0ba204
@ -22,6 +22,7 @@ import os
|
|||||||
import os.path as op
|
import os.path as op
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import stat
|
import stat
|
||||||
|
import shutil
|
||||||
try:
|
try:
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -100,7 +101,7 @@ def trash_move(src, dst, topdir=None):
|
|||||||
check_create(filespath)
|
check_create(filespath)
|
||||||
check_create(infopath)
|
check_create(infopath)
|
||||||
|
|
||||||
os.rename(src, op.join(filespath, destname))
|
shutil.move(src, op.join(filespath, destname))
|
||||||
f = open(op.join(infopath, destname + INFO_SUFFIX), 'w')
|
f = open(op.join(infopath, destname + INFO_SUFFIX), 'w')
|
||||||
f.write(info_for(src, topdir))
|
f.write(info_for(src, topdir))
|
||||||
f.close()
|
f.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user