Use utf-8 for python file reading
authorPaul Bauer <paul.bauer.q@gmail.com>
Tue, 14 Jan 2020 07:01:30 +0000 (08:01 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Fri, 24 Jan 2020 09:50:55 +0000 (10:50 +0100)
Avoids crashing on non-ascii characters

Also needed in release-2020 due to https://gitlab.com/gromacs/gromacs/pipelines/111716110

Change-Id: Ie489110bbe37619d36f8feb739e04ef60cccff16

admin/copyright.py

index 8d57385a116f1c0e7e0bc64459d11dc08241762b..4923fdab9a958c2d972626af80b23711f0e3960f 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013,2014,2015,2016,2018,2019, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2016,2018,2019,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -393,7 +393,7 @@ def main():
             contents = sys.stdin.read().splitlines()
             reporter = Reporter(sys.stderr, '<stdin>')
         else:
-            with open(filename, 'r') as inputfile:
+            with open(filename, 'r', encoding='utf-8') as inputfile:
                 contents = inputfile.read().splitlines()
             reporter = Reporter(sys.stdout, filename)