bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newline handling


From: Collin Funk
Subject: Newline handling
Date: Wed, 27 Mar 2024 19:38:32 -0700
User-agent: Mozilla Thunderbird

On 3/27/24 7:29 PM, Bruno Haible wrote:
> They can recommend it. But what we want here is to recognize Unix
> newlines, not macOS 9 newlines or DOS/Windows newlines. It should
> behave like gnulib-tool.sh, and thus newline='\n' is appropriate here.

Ah, I wasn't paying attention much to the newlines in gnulib-tool.sh.
I can go through all the open() and codec.open() calls and turn them
into:

        with open(file_name, 'r', encoding='utf-8', newline='\n') as file:
             # do something

and

        with open(file_name, 'w', encoding='utf-8', newline='\n') as file:
             # do something

in that case. I think that should make everything work correctly.
Would that be good?

Collin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]