[issue14562] urllib2 maybe blocks too long
report at bugs.python.org
Thu Apr 12 14:23:10 CEST 2012
New submission from Anrs Hu <anders.x.hu at gmail.com>:
If HTTP URL response's Transfer-Encoding is 'Chunked', then the urllib2.urlopen(URL).readline() will block until there're enough 8192 bytes, even though the first chunk is just a line.
Every chunks should be processed as soon as posible, so the readline() behavior should read a line and return immediately, rather than read 8K data to buffer and look up a line from the buffer.
components: Library (Lib)
title: urllib2 maybe blocks too long
versions: Python 2.7
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list