]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Fix breakage that I introduced with Collin's last patch.
authorBruno Haible <bruno@clisp.org>
Thu, 28 Mar 2024 02:21:52 +0000 (03:21 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 28 Mar 2024 02:21:52 +0000 (03:21 +0100)
* pygnulib/GLFileSystem.py (GLFileAssistant.add_or_update): Correct the
open calls.

pygnulib/GLFileSystem.py

index fe5e0507611dcf563cb86cc86cb4e76c224e5038..e06eab316ae4415e3f6b160bfaeb5020ffe4b458 100644 (file)
@@ -370,10 +370,10 @@ class GLFileAssistant(object):
                     transformer = sed_transform_testsrelated_lib_file
             if transformer != None:
                 # Read the file that we looked up.
-                with open(lookedup, 'rb', encoding='utf-8') as file:
+                with open(lookedup, 'r', newline='\n', encoding='utf-8') as file:
                     src_data = file.read()
                 # Write the transformed data to the temporary file.
-                with open(tmpfile, 'wb', encoding='utf-8') as file:
+                with open(tmpfile, 'w', newline='\n', encoding='utf-8') as file:
                     file.write(re.sub(transformer[0], transformer[1], src_data))
         path = joinpath(self.config['destdir'], rewritten)
         if isfile(path):