Testlib/generate_expected_output.py: Fix encoding.

Do not apply additional encoding when reading process output.
Fixes errors when encountering UTF-8:

Traceback (most recent call last):
  File "./generate_expected_output.py", line 117, in <module>
    generateTestData(path)
  File "./generate_expected_output.py", line 106, in generateTestData
    out.write(data.decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position 5485: ordinal not in range(128)

Change-Id: Ib827787a59a18b4d3d0601645856517f43c01fc3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Friedemann Kleint 2014-01-17 09:31:05 +01:00 committed by The Qt Project
parent f504287e80
commit d5912b2a47

View File

@ -105,7 +105,7 @@ def generateTestData(testname):
result = 'expected_' + testname + '.' + format
data = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True).communicate()[0]
out = open(result, 'w')
out.write(data.decode('utf-8'))
out.write(data)
out.close()
replaceInFile(result)