We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 787ded9 commit 276fcb0Copy full SHA for 276fcb0
patchwork/steps/ModifyCode/ModifyCode.py
@@ -7,7 +7,7 @@
7
8
def save_file_contents(file_path, content):
9
"""Utility function to save content to a file."""
10
- with open(file_path, "w") as file:
+ with open(file_path, "w", newline="") as file:
11
file.write(content)
12
13
@@ -45,7 +45,7 @@ def replace_code_in_file(
45
46
if path.exists() and start_line is not None and end_line is not None:
47
"""Replaces specified lines in a file with new code."""
48
- text = path.read_text()
+ text = path.read_text(newline="")
49
50
lines = text.splitlines(keepends=True)
51
0 commit comments