[issue900744] catch invalid chunk length in httplib read routine

Philip Dorrell report at bugs.python.org
Sat Jun 28 11:37:15 CEST 2008


Philip Dorrell <general2 at 1729.com> added the comment:

I have raised a "bug" 125 for boto (
http://code.google.com/p/boto/issues/detail?id=125 ) in relation to this
problem, because if httplib.py is not fixed in Python 2.5, then any code
calling httplib.py has to work around it by handling a ValueError
exception when it occurs.

With regard to the fix in Python 2.6, and reading through the httplib.py
source, I conclude:

* IncompleteRead(value) means something like "we were expecting to read
X bytes but actually there aren't any more, and so far we have read
*value*".
* This meaning does not quite describe the error which this issue is
about, which really needs its own separate exception class, e.g.
InvalidHttpResponseChunkSize(value, badSize) meaning "we were expecting
to read the size of the next chunk, but *badSize* is not a valid number,
and so far we have read *value*)

----------
nosy: +pdorrell

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue900744>
_______________________________________


More information about the Python-bugs-list mailing list