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 30b8abd commit 787ded9Copy full SHA for 787ded9
reproduce_issue.py
@@ -0,0 +1,21 @@
1
+def read_and_write_file(filepath):
2
+ # Read the file and print original line endings
3
+ with open(filepath, 'rb') as f:
4
+ content = f.read()
5
+ print(f"Original line endings (hex):", content.hex())
6
+
7
+ # Read using current implementation approach
8
+ with open(filepath, 'r') as f:
9
10
11
+ # Write back using current implementation approach
12
+ with open(filepath + '.modified', 'w') as f:
13
+ f.write(content)
14
15
+ # Read the modified file and print new line endings
16
+ with open(filepath + '.modified', 'rb') as f:
17
+ modified = f.read()
18
+ print(f"Modified line endings (hex):", modified.hex())
19
20
+if __name__ == "__main__":
21
+ read_and_write_file('test_lineendings.py')
0 commit comments