From e3c28cf06086846e68ac2b155680bbfd1d7f98e8 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Feb 26 2019 12:07:21 +0000 Subject: downloadTaskOutput fix for py3 Fixes: https://pagure.io/koji/issue/1289 --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 5403306..4765158 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -9214,7 +9214,7 @@ class RootExports(object): if not os.path.isfile(filePath): raise koji.GenericError('no file "%s" output by task %i' % (fileName, taskID)) # Let the caller handler any IO or permission errors - with open(filePath, 'r') as f: + with open(filePath, 'rb') as f: if isinstance(offset, str): offset = int(offset) if offset != None and offset > 0: diff --git a/koji/__init__.py b/koji/__init__.py index f93d9ea..89e6581 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -2827,6 +2827,8 @@ class ClientSession(object): if volume and volume != 'DEFAULT': dlopts['volume'] = volume result = self.callMethod('downloadTaskOutput', taskID, fileName, **dlopts) + # py3 doesn't return encodable string + result = str(result) return base64.decodestring(result.encode('ascii'))