From c15613b8b3929fab9ccb6f09ac76131aef88a4dd Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Thu, 13 Jun 2019 09:54:24 +1000 Subject: [PATCH] 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 --- lftools/deploy.py | 5 ++--- releasenotes/notes/no-encode-py3-44307e6fd97c2d0c.yaml | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 releasenotes/notes/no-encode-py3-44307e6fd97c2d0c.yaml 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. -- 2.16.6