Fix testsuite for python3 when reading utf-8 scripts
authorThomas Krennwallner <tkren@kr.tuwien.ac.at>
Mon, 5 Feb 2018 06:31:16 +0000 (06:31 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 14 Mar 2019 17:34:56 +0000 (17:34 +0000)
===================================================================

Gbp-Pq: Name gringo-python3-utf8.patch

app/clingo/tests/run.py

index 63032f542688679e75a546b21fc5789409819d96..7da85a1a432690adc6e28d4f119a7a0156ca2278 100755 (executable)
@@ -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 \