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