Skip to content

Commit 68d301e

Browse files
committed
post.py: upload files regardless of the os.linesep
1 parent c3d7f13 commit 68d301e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

post.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import socket
1313
import time
1414
import sys
15+
import os
1516

1617
RECV_SIZE = 1024
1718
POW_LIMIT = 50_000_000
@@ -51,8 +52,7 @@ def usage(program_name: str):
5152
file_path = args.pop(0)
5253

5354
with open(file_path) as f:
54-
# TODO: This script expects files to have Unix newlines, should probably work with any newlines.
55-
content = [line.strip('\n') for line in f.readlines()]
55+
content = [line.removesuffix(os.linesep) for line in f.readlines()]
5656

5757
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
5858

0 commit comments

Comments
 (0)