Message125384
> But the comment is actually wrong: It says
>
> len <= buf_size <= INT_MAX (see above)
>
> however, len > buf_size may happen, after this code:
>
> if (len > buf_size) {
> PyErr_Format(PyExc_ValueError,
> "read() returned too much data: "
> "%i bytes requested, %zd returned",
> buf_size, len);
> goto finally;
> }
Oh. Not only is the comment is wrong, but the code is also wrong. It
should return a negative value on error, whereas it returns the string
length which is always positive (except on a unlikely Py_ssize_t => int
overflow?). |
|
Date |
User |
Action |
Args |
2011-01-04 23:55:11 | vstinner | set | recipients:
+ vstinner, loewis, amaury.forgeotdarc, pitrou, schmir, brian.curtin, janglin |
2011-01-04 23:55:09 | vstinner | link | issue9566 messages |
2011-01-04 23:55:09 | vstinner | create | |
|