From: Anil Belur Date: Wed, 12 Jun 2019 23:54:24 +0000 (+1000) Subject: Revert "Use six.text_type rather than str.encode" X-Git-Tag: v0.25.0~3 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=c15613b8b3929fab9ccb6f09ac76131aef88a4dd;p=releng%2Flftools.git Revert "Use six.text_type rather than str.encode" This reverts commit e99dca16eef12f2e09c7911cc145ed637f9584bc. The change was tested with ODL merge job and does not work. Reverting this until we have this properly tested with the jobs. Change-Id: If1382188753ff590c767ce4ab5770f2c271fda69 Signed-off-by: Anil Belur --- diff --git a/lftools/deploy.py b/lftools/deploy.py index 00214c68..93a77a74 100644 --- a/lftools/deploy.py +++ b/lftools/deploy.py @@ -28,7 +28,6 @@ import zipfile from defusedxml.minidom import parseString import glob2 # Switch to glob when Python < 3.5 support is dropped import requests -import six log = logging.getLogger(__name__) @@ -310,11 +309,11 @@ def deploy_logs(nexus_url, nexus_path, build_url): resp = requests.get('{}/consoleText'.format(_format_url(build_url))) with open('console.log', 'w+') as f: - f.write(str(six.text_type(resp.text.split(MAGIC_STRING)[0]))) + f.write(str(resp.text.split(MAGIC_STRING)[0].encode('utf-8'))) resp = requests.get('{}/timestamps?time=HH:mm:ss&appendLog'.format(_format_url(build_url))) with open('console-timestamp.log', 'w+') as f: - f.write(str(six.text_type(resp.text.split(MAGIC_STRING)[0]))) + f.write(str(resp.text.split(MAGIC_STRING)[0].encode('utf-8'))) _compress_text(work_dir) diff --git a/releasenotes/notes/no-encode-py3-44307e6fd97c2d0c.yaml b/releasenotes/notes/no-encode-py3-44307e6fd97c2d0c.yaml deleted file mode 100644 index 4c9f2aa8..00000000 --- a/releasenotes/notes/no-encode-py3-44307e6fd97c2d0c.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -fixes: - - | - Use six.text_type() rather than str.encode('utf-8') in deploy_logs, so that - strings are no longer rewritten as bytes objects in Python 3.