From: Thomas Krennwallner Date: Mon, 5 Feb 2018 06:31:16 +0000 (+0000) Subject: Fix testsuite for python3 when reading utf-8 scripts X-Git-Tag: archive/raspbian/5.3.0-13+rpi1~1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d8829db810235c74fb76fce39aaa4e50a9893a1a;p=gringo.git Fix testsuite for python3 when reading utf-8 scripts =================================================================== Gbp-Pq: Name gringo-python3-utf8.patch --- diff --git a/app/clingo/tests/run.py b/app/clingo/tests/run.py index 63032f5..7da85a1 100755 --- a/app/clingo/tests/run.py +++ b/app/clingo/tests/run.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import re import os @@ -133,7 +133,7 @@ if parse_ret.action == "run": for f in sorted(files): if f.endswith(".lp"): b = os.path.join(root, f[:-3]) - inst = open(b + ".lp", 'rU').read() + inst = open(b + ".lp", 'rU', encoding='utf-8').read() if (not with_python and re.search(r"#script[ ]*\(python\)", inst)) or \ (not with_lua and re.search(r"#script[ ]*\(lua\)", inst)) or \ (not with_threads and re.search("async=", inst)) or \