From 6782e09111d13da87254cf7e5f9f3b8178de44e3 Mon Sep 17 00:00:00 2001 From: Alexander Galazin Date: Sun, 24 May 2020 14:34:12 +0200 Subject: [PATCH] Force Popen to text mode Components: Framework Change-Id: Idee7eee4e4f0cd2255c384f447ffe743f09d5a0b (cherry picked from commit 68eda3f13422a8faac7c46da087132d7c021fe18) --- external/fetch_sources.py | 2 +- external/openglcts/scripts/mustpass.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/external/fetch_sources.py b/external/fetch_sources.py index 0575c14..3896b1a 100644 --- a/external/fetch_sources.py +++ b/external/fetch_sources.py @@ -238,7 +238,7 @@ class GitRepo (Source): def detectProtocol(self, cmdProtocol = None): # reuse parent repo protocol - proc = subprocess.Popen(['git', 'ls-remote', '--get-url', 'origin'], stdout=subprocess.PIPE) + proc = subprocess.Popen(['git', 'ls-remote', '--get-url', 'origin'], stdout=subprocess.PIPE, universal_newlines=True) (stdout, stderr) = proc.communicate() if proc.returncode != 0: diff --git a/external/openglcts/scripts/mustpass.py b/external/openglcts/scripts/mustpass.py index 11cabf1..06a6abe 100644 --- a/external/openglcts/scripts/mustpass.py +++ b/external/openglcts/scripts/mustpass.py @@ -132,7 +132,7 @@ def getCommandLine (config): def readCaseList (filename): cases = [] - with open(filename, 'rb') as f: + with open(filename, 'rt') as f: for line in f: if line[:6] == "TEST: ": cases.append(line[6:].strip()) @@ -143,7 +143,7 @@ def getCaseList (buildCfg, generator, module): def readPatternList (filename): ptrns = [] - with open(filename, 'rb') as f: + with open(filename, 'rt') as f: for line in f: line = line.strip() if len(line) > 0 and line[0] != '#': @@ -242,11 +242,12 @@ def genSpecXML (mustpass): for package in mustpass.packages: for config in package.configurations: configElem = ElementTree.SubElement(packageElem, "Configuration", - useForFirstEGLConfig = str(package.useforfirsteglconfig), - name = config.name, caseListFile = getCaseListFileName(package, config), commandLine = getCommandLine(config), - os = str(config.os)) + name = config.name, + os = str(config.os), + useForFirstEGLConfig = str(package.useforfirsteglconfig) + ) return mustpassElem @@ -408,7 +409,7 @@ def genMustpass (mustpass, moduleCaseLists): specFilename = os.path.join(mustpass.project.path, mustpass.version, "mustpass.xml") print(" Writing spec: " + specFilename) - writeFile(specFilename, prettifyXML(specXML)) + writeFile(specFilename, prettifyXML(specXML).decode()) print("Done!") -- 2.7.4