mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
fix bug on move file over filesystem raise OSError
This commit is contained in:
parent
1f315abfda
commit
a6ef9be162
1 changed files with 3 additions and 2 deletions
|
@ -10,6 +10,7 @@ import queue
|
||||||
import logging
|
import logging
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import socket
|
import socket
|
||||||
|
import shutil
|
||||||
import time
|
import time
|
||||||
import hashlib
|
import hashlib
|
||||||
from os.path import relpath
|
from os.path import relpath
|
||||||
|
@ -331,7 +332,7 @@ class EventHandler(pyinotify.ProcessEvent):
|
||||||
newd = os.path.join(base, act.arch)
|
newd = os.path.join(base, act.arch)
|
||||||
newpath = os.path.join(newd, file)
|
newpath = os.path.join(newd, file)
|
||||||
if not same_existent_file(path, newpath):
|
if not same_existent_file(path, newpath):
|
||||||
os.rename(path, newpath)
|
shutil.move(path, newpath)
|
||||||
|
|
||||||
act.path = newpath
|
act.path = newpath
|
||||||
path = newpath
|
path = newpath
|
||||||
|
@ -601,4 +602,4 @@ class SpoolHandler(pyinotify.ProcessEvent):
|
||||||
|
|
||||||
def dispatch(self, path):
|
def dispatch(self, path):
|
||||||
filename = os.path.basename(path)
|
filename = os.path.basename(path)
|
||||||
os.rename(path, os.path.join(self.dstpath, filename))
|
shutil.move(path, os.path.join(self.dstpath, filename))
|
||||||
|
|
Loading…
Add table
Reference in a new issue