Antoine Pitrou added the comment: > I have not tried io.open(), nor would I suspect most users would > realize that they needed to do so, in order to get the canonical > behaviour from an operation called "write" on a file opened in > "append" mode.
The reason I'm asking is that open() is the same as io.open() in Python 3.x, which is currently the main development line. That said, I can find the results myself. Python 2 is in bugfix mode, so it's impossible to rewrite the I/O routines to use unbuffered I/O instead of C buffered I/O. > IMO: If pythons file.write() does not give the guarantee POLA would > indicate, it's either a bug or a doc-issue, no matter how many > workarounds might exist. What do you call POLA? > But I have neither a clue to the aspirational goals of python, nor to > what it might take to fix this, so it's entirely your call. Well as I said, Python 2 will be pretty much impossible to fix (we call fwrite() with the argument, not write()). Python 3 is a different story since we use our own buffering layer and then C's unbuffered API. As a sidenote, do you know if writev() has the same guarantee as write()? POSIX doesn't seem to say so. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15723> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com