Permalink
Browse files

Use shutil.move not os.rename:

This avoids errors when the file returned my tempfile.mkstemp is on a different device than the originals being transcoded.
  • Loading branch information...
1 parent 98d705a commit ec2d3af744a5480974f0bc7a8d53c4d73c959ac9 @NZKoz committed Jan 2, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 ocdtv/transcoder.py
View
@@ -7,6 +7,7 @@
"""Transcode files."""
import os
+import shutil
import time
import logging
import tempfile
@@ -40,7 +41,7 @@ def transcode_file(handbrake, preset, no_act, file_):
except:
pass
raise ex
- os.rename(spool, output)
+ shutil.move(spool, output)
logging.debug("Transcoded %s in %ds" % (os.path.basename(file_),
time.time() - st))
return output

0 comments on commit ec2d3af

Please sign in to comment.