Source: libpsl
Version: 0.18.0-3
Severity: serious
Tags: patch

Hi Daniel,

your -3 upload switching to python3 made libpsl FTBFS on all
architectures. Since building libpsl is important to me, I came up with
the attached patch to make it build again. It bypasses any locale
settings and forces the input file to be opened in utf-8 mode by passing
the encoding keyword argument to the relevant open function. Hope it
helps.

Helmut
Index: libpsl-0.18.0/src/psl-make-dafsa
===================================================================
--- libpsl-0.18.0.orig/src/psl-make-dafsa
+++ libpsl-0.18.0/src/psl-make-dafsa
@@ -685,7 +685,7 @@
     psl_nexceptions = 0
     psl_nwildcards = 0
 
-    with open(sys.argv[-2], 'r') as infile, open(sys.argv[-1], 'wb') as outfile:
+    with open(sys.argv[-2], 'r', encoding="utf-8") as infile, open(sys.argv[-1], 'wb') as outfile:
       outfile.write(converter(parser(infile, utf_mode, codecs), utf_mode, codecs))
 
   return 0

Reply via email to