Skip to content

Commit c70759d

Browse files
Use shutil.move instead of os.rename
It fixes the error like 'OSError: [Errno 18] Invalid cross-device link' Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
1 parent 48408a1 commit c70759d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/extractcode/uncompress.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import gzip
3131
import logging
3232
import os
33+
from shutil import move
3334

3435
try:
3536
# These imports add support for multistream BZ2 files
@@ -68,7 +69,7 @@ def uncompress(location, target_dir, decompressor, suffix=EXTRACT_SUFFIX):
6869
target_location = os.path.join(target_dir, os.path.basename(location) + suffix)
6970
if os.path.exists(target_location):
7071
fileutils.delete(target_location)
71-
os.rename(tmp_loc, target_location)
72+
move(tmp_loc, target_location)
7273
return warnings
7374

7475

0 commit comments

Comments
 (0)