Message158246
| Author |
Anrs.Hu |
| Recipients |
Anrs.Hu, Jim.Jewett, orsenthil |
| Date |
2012年04月14日.01:55:38 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334368538.92.0.324306327958.issue14562@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月14日 01:55:39 | Anrs.Hu | set | recipients:
+ Anrs.Hu, orsenthil, Jim.Jewett |
| 2012年04月14日 01:55:38 | Anrs.Hu | set | messageid: <1334368538.92.0.324306327958.issue14562@psf.upfronthosting.co.za> |
| 2012年04月14日 01:55:38 | Anrs.Hu | link | issue14562 messages |
| 2012年04月14日 01:55:38 | Anrs.Hu | create |
|