Wenn ich das selbe in der Shell mit "mv" mache, geht's... Auch per subprocess funktioniert es.
Bsp:
Code: Alles auswählen
filepath = "/home/jens/Photos/2007/1/4/P1030509.JPG"
dest_path = "/home/jens/Photos/2007/01/04" # <- auch mit Slash am Ende
shutil.move(filepath, dest_path) # <- geht nicht
# das geht:
process = subprocess.Popen(
['mv', filepath, dest_path],
stdout=subprocess.PIPE
)
process.wait()
print process.stdout.read()
Was auch nicht geht ist ein os.utime(fn, (atime, mtime)) nach dem kopieren... Es liefert auch nur ein "Error: [Errno 1] Operation not permitted".
Jemand eine Idee?