#1290 downloadTaskOutput fix for py3
Merged 5 years ago by mikem. Opened 5 years ago by tkopecek.
tkopecek/koji issue1289  into  master

file modified
+1 -1
@@ -9214,7 +9214,7 @@ 

          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:

file modified
+2
@@ -2827,6 +2827,8 @@ 

          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'))

  

  

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

5 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

5 years ago

This changes the API

The downloadTaskOutput handler returns a string that contains base64 encoded data. It does not use the base64 tag in xmlrpc encoding. With this change, it returns binary data encoded in a base64 xmlrpc tag (so double base64 encoded), but only on a py3 hub.

@tkopecek how does that look to you?

Commit 3a1e9a9 fixes this pull-request

Pull-Request has been merged by mikem

5 years ago