From 0385478f911918d06944c286c86c6bb9f64c7140 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sat, 13 Jun 2015 17:24:38 +0200 Subject: [PATCH] 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. --- driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver.py b/driver.py index 0a26e71..7ef9d35 100755 --- a/driver.py +++ b/driver.py @@ -40,7 +40,7 @@ tests_path = 'test/' def readfile(fname): '''Reads a file as string and returns its content''' - fd = open(fname) + fd = open(fname,encoding='utf-8') expr = fd.read() fd.close() return expr