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)
committerAdrian Bunk <bunk@debian.org>
Sat, 19 Nov 2022 10:33:48 +0000 (10:33 +0000)
===================================================================

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

app/clingo/tests/run.py

index 640ae0f5f4d0594d30eae7a05953bb7877181f8a..687089d65426a3c9bece30ad1f0f4174c7d192f6 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import re
 import os
@@ -134,7 +134,7 @@ if parse_ret.action == "run":
         for f in sorted(files):
             if f.endswith(".lp"):
                 b = os.path.join(root, f[:-3])
-                with open(b + ".lp", 'rU') as inst_file:
+                with open(b + ".lp", 'rU', encoding='utf-8') as inst_file:
                     inst = inst_file.read()
                     if (not with_python and re.search(r"#script[ ]*\(python\)", inst)) or \
                        (not with_lua and re.search(r"#script[ ]*\(lua\)", inst)) or \