Author vstinner
Recipients vstinner
Date 2014-01-03.11:19:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1388747968.16.0.893473617326.issue20113@psf.upfronthosting.co.za>
In-reply-to
Content
Example:

$ python3
Python 3.3.2 (default, Nov  8 2013, 13:38:57) 
[GCC 4.8.2 20131017 (Red Hat 4.8.2-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.fstat(19)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 9] Bad file descriptor
>>> buf=bytearray(10)
>>> os.readv(19, [buf])
-1

I would expect an OSError on os.readv() instead of -1.

Moreover, empty list of buffers are not handled correctly:

$ python3
Python 3.3.2 (default, Nov  8 2013, 13:38:57) 
[GCC 4.8.2 20131017 (Red Hat 4.8.2-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.readv(0, [])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: error return without exception set

Attached patch should fix both issues.
History
Date User Action Args
2014-01-03 11:19:28vstinnersetrecipients: + vstinner
2014-01-03 11:19:28vstinnersetmessageid: <1388747968.16.0.893473617326.issue20113@psf.upfronthosting.co.za>
2014-01-03 11:19:28vstinnerlinkissue20113 messages
2014-01-03 11:19:27vstinnercreate