Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue14562] urllib2 maybe blocks too long with small chunks

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Apr 13, 2012, 12:07 PM

Post #1 of 3 (95 views)
Permalink
[issue14562] urllib2 maybe blocks too long with small chunks

Changes by Jim Jewett <jimjjewett [at] gmail>:


----------
title: urllib2 maybe blocks too long -> urllib2 maybe blocks too long with small chunks

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14562>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 13, 2012, 6:55 PM

Post #2 of 3 (93 views)
Permalink
[issue14562] urllib2 maybe blocks too long with small chunks [In reply to]

Anrs Hu <anders.x.hu [at] gmail> added the comment:

Okay, there's a test case of web.py:

Server codes are following:
import web
class index(object):
def GET(self):
yield 'hello\n'
yield 'world\n'
time.sleep(60)

client is Python interpreter
>>> resp = urllib.urlopen(URL)
>>> resp.readline() # will be 'hello'
>>> resp.readline() # will be 'world'
>>> resp.readline() # huh, it's blocked, and we to agree with it.

>>> # but to use urllib2 will another behavor.
>>> urllib2.urlopen(URL).readline() # huh, it's blocked even if 'hello' and 'world' returned yet. Because urllib2 uses a 8KiB buffer on socket._fileobjece within urllib2.py, it read 8K data to buffer first.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14562>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 15, 2012, 11:10 PM

Post #3 of 3 (89 views)
Permalink
[issue14562] urllib2 maybe blocks too long with small chunks [In reply to]

Changes by Qiangning Hong <hongqn [at] gmail>:


----------
nosy: +hongqn

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14562>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.