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
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson,, stutzbach
Priority: normal Keywords: patch

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

File name Uploaded Description Edit
readinto_error.patch, 2016-10-29 17:07 review
Pull Requests
URL Status Linked Edit
PR 7496 merged, 2018-06-07 20:57
Messages (2)
msg279685 - (view) Author: David Szotten ( * 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)
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