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
foreign-platform newline support #35434
Comments
This patch enables Python to interpret all known This support is enabled by configuring with With universal newline support enabled two things
File objects have a new attribute "newlines" which Also included is a test script which tests both file |
Logged In: YES Tim, can you review this or pass it on to someone else who Jack developed this patch after a discussion in which I was |
Logged In: YES It would be better if get_line just called Py_UniversalNewlineFgets and Py_UniversalNewlineFread The new routines never check for I/O errors! Why not? It The new Fgets checks for EOF at the end of the loop instead newlinetypes |= NEWLINE_CR; immediately after seeing an '\r' would be as fast (instead Speaking of which <wink>, the fobj tests in the inner loop Floating the univ_newline test out of the loop (and Doing fread one character at a time is very inefficient. It would be fine by me if you included (and initialized) I'll be damned if I can think of a quick way to do this |
Logged In: YES Here's a new version of the patch. To address your issues
There's also a new test script, that tests some more border |
Logged In: YES Back to Jack -- and sorry for sitting on it so long. If a PEP won't be written, I suggest finding someone else |
Logged In: YES This version of the patch addresses the bug in Py_UniversalNewlineFread and fixes up some minor details. Tim's other issues are addressed (at least: I think they are:-) in a forthcoming PEP. |
Logged In: YES A new version of the patch. Main differences are that U is now the mode character to trigger universal newline input and --with-universal-newlines is default on. |
Logged In: YES Thanks! But there's no documentation. Could I twist your arm I'm tempted to give this a +1, but I'd like to hear from MvL |
Logged In: YES New doc patch, and new version of the patch that mainly allows the U to be specified (no-op) in non-univ-newline-builds. |
Logged In: YES What is the rationale for making this a compile-time option? If this is for backwards compatibility, don't make it an Apart from that, the patch looks goo.d |
Logged In: YES A final tweaks: return a tuple of newline values in stead of 'mixed'. |
Logged In: YES Barry, |
Logged In: YES I'll be committing the documentation changes momentarily. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: