To solve the issue #110.
I faced the same problem on my Windows environment.
nbstripout converts my ipynb file newline from LF to CRLF when I committing.
Bug Cause
About the newline parameter of open method and TextIOWrapper method
When writing output to the stream, if newline is None, any '\n' characters written are translated to the system default line separator, os.linesep.
The string used to separate (or, rather, terminate) lines on the current platform. This may be a single character, such as '\n' for POSIX, or multiple characters, for example, '\r\n' for Windows.
Purpose
To solve the issue #110. I faced the same problem on my Windows environment. nbstripout converts my ipynb file newline from LF to CRLF when I committing.
Bug Cause
About the newline parameter of
open
method andTextIOWrapper
methodhttps://docs.python.org/3/library/io.html#io.TextIOWrapper https://docs.python.org/3/library/functions.html#open-newline-parameter
os.linesep is
https://docs.python.org/3/library/os.html#os.linesep
Bug Fix
Add
newline=''
parameter toopen
method andTextIOWrapper
methodhttps://docs.python.org/3/library/io.html#io.TextIOWrapper https://docs.python.org/3/library/functions.html#open-newline-parameter
This is my first pull request.
So I don't know if this is right way of pull request. If there is any problem, please tell me.