SSLError: The read operation timed out

83 views
Skip to first unread message

易斌

unread,
Nov 19, 2012, 12:15:42 AM11/19/12
to sae-p...@googlegroups.com
一个sae的应用,功能是调用instagram的api,已经os.environ['disable_fetchurl'] = True了,但这种超时的概率还是很高,默认超时时间是多长呢?
对这样的api的调用有没有好的建议?

Alan Chan

unread,
Nov 19, 2012, 3:00:41 AM11/19/12
to sae-p...@googlegroups.com
如果没有设置,httplib会使用默认的socket超时时间,目前是10s。

>>> import socket
>>> socket.getdefaulttimeout()
10.0

如果有超时的话,可以在调用urlopen的时候带上timeout参数。

一个sae的应用,功能是调用instagram的api,已经os.environ['disable_fetchurl'] = True了,但这种超时的概率还是很高,默认超时时间是多长呢?
对这样的api的调用有没有好的建议?

--
邮件来自: SAE Python 邮件列表
发言: sae-p...@googlegroups.com
退订: sae-python+...@googlegroups.com (向此发空信即退!)
 
 

Reply all
Reply to author
Forward
0 new messages