Fix encoding of the .gitignore file on Windows (#2797)

This commit is contained in:
Carlos Llatser 2024-03-06 18:40:55 +01:00 committed by GitHub
parent 1b207eb444
commit 2125701c2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -338,7 +338,7 @@ def initialize_gitignore():
files |= set([line.strip() for line in f.readlines()])
# Write files to the .gitignore file.
with open(constants.GitIgnore.FILE, "w") as f:
with open(constants.GitIgnore.FILE, "w", newline="\n") as f:
console.debug(f"Creating {constants.GitIgnore.FILE}")
f.write(f"{(path_ops.join(sorted(files))).lstrip()}")