Re: [Python-Dev] file objects guarantees

2014-04-28 Thread Guido van Rossum
File objects historically have a pretty vague spec. E.g. it's not defined which methods are supported beyond read() and readline() (for readers) or write() (for writers). Short writes shouldn't be allowed (a regular file object's write() doesn't even return a value for this reason). This means tha

[Python-Dev] file objects guarantees

2014-04-28 Thread Charles-François Natali
Hi, What's meant exactly by a "file object"? Let me be more specific: for example, pickle.dump() accepts a "file object". Looking at the code, it doesn't check the return value of its write() method. So it assumes that write() should always write the whole data (not partial write). Same thing