Переглянути джерело

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

Carlos Llatser 1 рік тому
батько
коміт
2125701c2d
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      reflex/utils/prerequisites.py

+ 1 - 1
reflex/utils/prerequisites.py

@@ -338,7 +338,7 @@ def initialize_gitignore():
             files |= set([line.strip() for line in f.readlines()])
             files |= set([line.strip() for line in f.readlines()])
 
 
     # Write files to the .gitignore file.
     # 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}")
         console.debug(f"Creating {constants.GitIgnore.FILE}")
         f.write(f"{(path_ops.join(sorted(files))).lstrip()}")
         f.write(f"{(path_ops.join(sorted(files))).lstrip()}")