Skip to content

Commit 476f732

Browse files
committed
Addressed copilot crlf concern
1 parent f2c52f4 commit 476f732

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/schema/test_hed_schema_io_df.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ def test_tsv_reading_handles_both_line_endings(self):
397397
with open(tag_lf, "rb") as f:
398398
lf_content = f.read()
399399

400-
crlf_content = lf_content.replace(b"\n", b"\r\n")
400+
# Normalize to LF first, then convert to CRLF to avoid double carriage returns
401+
crlf_content = lf_content.replace(b"\r\n", b"\n").replace(b"\n", b"\r\n")
401402

402403
# Write CRLF version
403404
os.makedirs(os.path.dirname(crlf_path), exist_ok=True)
@@ -421,8 +422,9 @@ def test_tsv_reading_handles_both_line_endings(self):
421422
if os.path.exists(src):
422423
with open(src, "rb") as f:
423424
content = f.read()
425+
# Normalize to LF first, then convert to CRLF to avoid double carriage returns
424426
with open(dst, "wb") as f:
425-
f.write(content.replace(b"\n", b"\r\n"))
427+
f.write(content.replace(b"\r\n", b"\n").replace(b"\n", b"\r\n"))
426428

427429
# Both should load successfully
428430
lf_schema = load_schema(lf_path)

0 commit comments

Comments
 (0)