[issue4579] .read() and .readline() differ in failing

2009-02-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: I'm going to close this as a duplicate of #4996 (same fix), which will be fixed when we merge the io-c branch. -- nosy: +benjamin.peterson resolution: -> duplicate status: open -> closed ___ Python tracker

[issue4579] .read() and .readline() differ in failing

2008-12-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Python 2 is very platform-dependent: fdopen simply call the C function fdopen() and returns a FILE*. Since the sample code is a mistake (read on a file open in write mode), how and when the error shows up really depends on the platform's

[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Calvin Spealman
Calvin Spealman <[EMAIL PROTECTED]> added the comment: Confirmed this behavior on my ubuntu installations but it fails properly on Windows. ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Calvin Spealman
Changes by Calvin Spealman <[EMAIL PROTECTED]>: -- nosy: +ironfroggy ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mai

[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Mark Florisson
Mark Florisson <[EMAIL PROTECTED]> added the comment: Perhaps it's linux specific then. I'm on debian lenny (2.6.26-1-amd64). ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Aaron Gallagher
Aaron Gallagher <[EMAIL PROTECTED]> added the comment: I can't reproduce this on python 2.5.1, 2.5.2, or 2.6.0 on Mac OS 10.5.4. Both .read() and .readline() raise an EBADF IOError. 3.0.0 fails in the same way. -- nosy: +habnabit ___ Python tracker

[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Mark Florisson
Mark Florisson <[EMAIL PROTECTED]> added the comment: s/actual/operation/ ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing

[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Mark Florisson
Mark Florisson <[EMAIL PROTECTED]> added the comment: Actually, I wouldn't expect it to fail like that, because it's not a bad file descriptor, it's an actual that doesn't agree with the (userspace) file mode. What I'd expect is probably a TypeError. Although an IOError, with a different message,

[issue4579] .read() and .readline() differ in failing

2008-12-07 Thread Mark Florisson
New submission from Mark Florisson <[EMAIL PROTECTED]>: >>> f = os.fdopen(os.open('spam!', os.O_TRUNC|os.O_CREAT|os.O_RDWR), 'w') >>> f.read() '' >>> f.readline() Traceback (most recent call last): File "", line 1, in IOError: [Errno 9] Bad file descriptor >>> f.write("spamspamhihi") >>> f.rea