Blob Blame History Raw
From 60c8ec5f937a28a5ec3d37f5d808c74fc4ef5735 Mon Sep 17 00:00:00 2001
From: Matej Marusak <mmarusak@redhat.com>
Date: Tue, 5 Sep 2017 10:48:31 +0200
Subject: [PATCH 3/4] client-python: Do not try to unlink None

Rhbz: #1416277

https://github.com/abrt/libreport/blob/master/src/client-python/reportclient/dnfdebuginfo.py#L135
returns None when downloading fails.

Signed-off-by: Matej Marusak <mmarusak@redhat.com>
---
 src/client-python/reportclient/debuginfo.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/client-python/reportclient/debuginfo.py b/src/client-python/reportclient/debuginfo.py
index 0385f716..4390304e 100644
--- a/src/client-python/reportclient/debuginfo.py
+++ b/src/client-python/reportclient/debuginfo.py
@@ -374,7 +374,8 @@ class DebugInfoDownload(object):
                 # I observed a zero-length file left on error,
                 # which prevents cleanup later. Fix it:
                 try:
-                    os.unlink(package_full_path)
+                    if package_full_path is not None:
+                        os.unlink(package_full_path)
                 except OSError:
                     pass
                 print(_("Downloading package {0} failed").format(pkg))
-- 
2.13.5