Set encoding in test driver
Python3 handles encoding differently, and files are loaded according to the locale set on the system. This means that when building on a locale-less chroot, the tests will always fail because it will try to load utf-8 and encode it as ASCII. This forces the encoding. The tests are encoded in utf-8 anyway so any other encoding set by the locale would cause a failure.
This commit is contained in:
parent
4c41132705
commit
0385478f91
@ -40,7 +40,7 @@ tests_path = 'test/'
|
|||||||
|
|
||||||
def readfile(fname):
|
def readfile(fname):
|
||||||
'''Reads a file as string and returns its content'''
|
'''Reads a file as string and returns its content'''
|
||||||
fd = open(fname)
|
fd = open(fname,encoding='utf-8')
|
||||||
expr = fd.read()
|
expr = fd.read()
|
||||||
fd.close()
|
fd.close()
|
||||||
return expr
|
return expr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user