#2977 py3 kojikamid fixes
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji kojikamidpy3  into  master

file modified
+6 -5
@@ -1,4 +1,4 @@ 

- #!/usr/bin/python2

+ #!/usr/bin/python3

  

  # Koji daemon that runs in a Windows VM and executes commands associated

  # with a task.
@@ -32,6 +32,7 @@ 

  import logging

  import os

  import re

+ import six # needed for imported code

  import subprocess

  import sys

  import tempfile
@@ -548,11 +549,11 @@ 

          logger = logging.getLogger('koji.vm')

          logger.info('$ %s', ' '.join(cmd))

          proc = subprocess.Popen(cmd, stdout=logfd, stderr=subprocess.STDOUT,

-                                 close_fds=True)

+                                 close_fds=True, text=True)

          ret = proc.wait()

      else:

          proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,

-                                 close_fds=True)

+                                 close_fds=True, text=True)

          output, dummy = proc.communicate()

          ret = proc.returncode

      if olddir:
@@ -607,7 +608,7 @@ 

          data = fobj.read(131072)

          if not data:

              break

-         encoded = base64.b64encode(data)

+         encoded = base64.b64encode(data).decode()

          server.upload(path, encode_int(offset), encoded)

          offset += len(data)

          sum.update(data)
@@ -700,7 +701,7 @@ 

              contents = fd.read(65536)

              if contents:

                  size = len(contents)

-                 data = base64.b64encode(contents)

+                 data = base64.b64encode(contents).decode()

                  digest = hashlib.sha256(contents).hexdigest()

                  del contents

                  try:

Metadata Update from @tkopecek:
- Pull-request tagged with: no_qe

2 years ago

Commit 59879c6 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago
Metadata