Skip to content

Commit 787ded9

Browse files
author
patched.codes[bot]
committed
Patched reproduce_issue.py
1 parent 30b8abd commit 787ded9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

reproduce_issue.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
content = f.read()
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

Comments
 (0)