Skip to content

Commit

Permalink
Merge pull request #164 from techtonik/patch-1
Browse files Browse the repository at this point in the history
Write notebooks with Unix newlines on Windows
  • Loading branch information
minrk committed Jul 1, 2015
2 parents 3ee4efd + 535a04d commit 8336768
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions notebook/services/contents/fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def atomic_writing(path, text=True, encoding='utf-8', **kwargs):
shutil.copy2(path, tmp_path)

if text:
# Make sure that text files have Unix linefeeds by default
kwargs.setdefault('newline', '\n')
fileobj = io.open(path, 'w', encoding=encoding, **kwargs)
else:
fileobj = io.open(path, 'wb', **kwargs)
Expand Down

0 comments on commit 8336768

Please sign in to comment.