classification
Title: error message for bad raw readinto
Type: Stage: resolved
Components: IO Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, davidszotten@gmail.com, stutzbach
Priority: normal Keywords: patch

Created on 2016-10-29 17:07 by davidszotten@gmail.com, last changed 2020-06-15 23:54 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
readinto_error.patch davidszotten@gmail.com, 2016-10-29 17:07 review
Pull Requests
URL Status Linked Edit
PR 7496 merged davidszotten@gmail.com, 2018-06-07 20:57
Messages (2)
msg279685 - (view) Author: David Szotten (davidszotten@gmail.com) * Date: 2016-10-29 17:07
Was just tracking down a bug in eventlet, which manifested as "OSError: raw readinto() returned invalid length -1 (should have been between 0 and 8192)"

I was misled for a while by the fact that readinto was in fact returning b'', not -1. This improves the error message in that case by including the TypeError from the failed conversion of b'' to an int.

Would prefer to still return an OSError with the TypeError as a cause, but couldn't figure out how to do that. Hints/help would be appreciated.
msg371606 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2020-06-15 23:54
New changeset 8666356280084f0426c28a981341f72eaaacd006 by David Szotten in branch 'master':
closes bpo-28557: error message for bad raw readinto (GH-7496)
https://github.com/python/cpython/commit/8666356280084f0426c28a981341f72eaaacd006
History
Date User Action Args
2020-06-15 23:54:01benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg371606

stage: patch review -> resolved
2020-06-11 14:14:45remi.lapeyresetversions: + Python 3.8, Python 3.9, Python 3.10
2018-06-08 18:27:56r.david.murraysetnosy: + benjamin.peterson, stutzbach
2018-06-07 20:57:21davidszotten@gmail.comsetstage: patch review
pull_requests: + pull_request7121
2016-10-29 17:07:24davidszotten@gmail.comcreate