From: Bruno Haible Date: Thu, 28 Mar 2024 02:21:52 +0000 (+0100) Subject: gnulib-tool.py: Fix breakage that I introduced with Collin's last patch. X-Git-Tag: v1.0~219 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=142fec3cb2dbe1f90bcd7599d7f4bb35caabe1d1;p=thirdparty%2Fgnulib.git gnulib-tool.py: Fix breakage that I introduced with Collin's last patch. * pygnulib/GLFileSystem.py (GLFileAssistant.add_or_update): Correct the open calls. --- diff --git a/pygnulib/GLFileSystem.py b/pygnulib/GLFileSystem.py index fe5e050761..e06eab316a 100644 --- a/pygnulib/GLFileSystem.py +++ b/pygnulib/GLFileSystem.py @@ -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):