> > If a program is running on a windows box, and writing a file on a *nix > > server, what kind of line ending should it write? Would it even know > > what the native format is on the server? It seems we would need to be > > able to specify the line ending format explicitly for writing. > > Yes, I think that's the best that can be done. To do any better > would require all file servers to be aware of the text/binary > distinction and be willing to translate, and for there to be > some way for the Python file object to communicate to the OS > which mode is intended. Neither of these things are true in > general. You might need to be able to specify a specific line ending format, but there should also be a default -- and it should be the default appropriate to the OS. So, \n on Unix, \r\n on Windows, \r on Mac running in "Mac mode", and \n on MacOS X running in "Unix mode". --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4