From 85c51874880d79f5241440a665c63774f4b50c2b Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 7 Sep 2017 11:11:15 -0400 Subject: [PATCH] move psl-make-dafsa to python3 Modern systems shouldn't need python 2. psl-make-dafsa should work with py3 just fine, as long as we know the source file is UTF-8. --- src/psl-make-dafsa | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/psl-make-dafsa b/src/psl-make-dafsa index eb304a1..6e85229 100755 --- a/src/psl-make-dafsa +++ b/src/psl-make-dafsa @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE.chromium file. @@ -685,7 +685,7 @@ def main(): 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