-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: Savetxt may ignore newline character on Windows: #3976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm not clear on the issue here, but generally LGTM. The change needs a test, and the commit message needs fixing, something like:
|
Does |
Sorry, I'm new to all this. Is there a quick-start-guide anywhere?
|
There is http://docs.scipy.org/doc/numpy/dev/, but is may not have what you are looking for. To edit commit messages or squash commits for fixes, the easiest way it For tests, look to use existing tests as templates. The place for the test will be somewhere in |
Under some circumstances savetxt ignores the newline character on Python 2.7 running on Windows: If newline is set to '\n', actually '\n\r' is written, because of the linesep conversion of file.write. Closes #3975.
Thanks for your help. After looking at |
Tests the correct usage of newline in savetxt. See #3976
Running my test with the unpatched version fails, as expected:
With the patched version the test is passed, but 7 others fail: Possible solutions:
What do you think? |
@816-8055 Sorry for the long pause. I think the issues you raise would be best discussed on the mailing list before proceeding. |
fh = open(fname, 'wb') | ||
else: | ||
fh = open(fname, 'w') | ||
fh = open(fname, 'wb') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do this because of the use of os.linesp
? Might be worth a comment.
Tests the correct usage of newline in savetxt. See numpy#3976
Under some circumstances savetxt ignores the newline character on Python 2.7 running on Windows:
If newline is set to '\n', actually '\n\r' is written, because of the linesep conversion of file.write.
Closes #3975.