Skip to content

Commit 9f54f83

Browse files
committed
Preserve Windows CRLF file endings in output file, closes #202
Leaving `newline` as the default of `None` gives us the desired semantics: When *reading*, all newlines are translated to `\n`. When writing, all newlines are translated to `os.linesep`.
1 parent d4ead20 commit 9f54f83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nbstripout/_nbstripout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def main():
592592
continue
593593

594594
try:
595-
with io.open(filename, 'r+', encoding='utf8', newline='') as f:
595+
with io.open(filename, 'r+', encoding='utf8') as f:
596596
out = output_stream if args.textconv or args.dry_run else f
597597
if process_notebook(
598598
input_stream=f, output_stream=out, args=args, extra_keys=extra_keys, filename=filename

0 commit comments

Comments
 (0)