From 2d61ca88834549f4ec11ed8bbc4906e0e442702e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 12 Nov 2018 14:45:39 +0100 Subject: [PATCH] donate-cpu: try to handle OSError when unpacking a tar file --- tools/donate-cpu.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/donate-cpu.py b/tools/donate-cpu.py index 00fabdc44..836039aa6 100644 --- a/tools/donate-cpu.py +++ b/tools/donate-cpu.py @@ -164,8 +164,11 @@ def unpackPackage(workPath, tgz): # Skip dangerous file names continue elif member.name.lower().endswith(('.c', '.cl', '.cpp', '.cxx', '.cc', '.c++', '.h', '.hpp', '.hxx', '.hh', '.tpp', '.txx')): - tf.extract(member.name) - print(member.name) + try: + tf.extract(member.name) + print(member.name) + except OSError: + pass tf.close() os.chdir(workPath)