From: Hans-Christoph Steiner Date: Fri, 1 Dec 2017 13:08:42 +0000 (+0100) Subject: shutil.move() in apk_strip_signature() to work across filesystems X-Git-Tag: 1.0.0~46^2~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2983c353615b8d0aa0d70ef616ec1507c617f646;p=fdroidserver.git shutil.move() in apk_strip_signature() to work across filesystems os.rename() only works if source and destination are on the same file system, shutil.move() works across file systems. OSError: [Errno 18] Invalid cross-device link: '/builds/eighthave/fdroidclient/app/build/outputs/apk/app-debug.apk' -> '/tmp/tmp966vh75f/tmp.apk' --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 24c695e2..e15651d3 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -2368,7 +2368,7 @@ def apk_strip_signatures(signed_apk, strip_manifest=False): """ with tempfile.TemporaryDirectory() as tmpdir: tmp_apk = os.path.join(tmpdir, 'tmp.apk') - os.rename(signed_apk, tmp_apk) + shutil.move(signed_apk, tmp_apk) with ZipFile(tmp_apk, 'r') as in_apk: with ZipFile(signed_apk, 'w') as out_apk: for info in in_apk.infolist():