Skip to content

Commit f863c63

Browse files
Jaroslaw.WalaszekJaroslaw.Walaszek
Jaroslaw.Walaszek
authored and
Jaroslaw.Walaszek
committed
Add automatic conversion from windows line endings to unix
1 parent 2c0b2c8 commit f863c63

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zip_file/archive.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def main():
3030
try:
3131
with zipfile.ZipFile(data['output_path'], mode='w') as zf:
3232
for file_path in sorted(file_paths, key=lambda d: d['filename']):
33-
file_bytes = open(file_path['filepath'], "rb").read()
33+
file_bytes = open(file_path['filepath'],
34+
"rb").read().decode().replace('\r\n', '\n')
35+
file_bytes = file_bytes.encode()
3436
info = zipfile.ZipInfo(
3537
str(file_path['filename']),
3638
date_time=(1980, 1, 1, 00, 00, 00),

0 commit comments

Comments
 (0)