以下代码在我自己的机器上运行得很好,但当从Microsoft Azure云中的服务器运行时,它会抛出异常。在我上次检查的时候(几周前),这个方法工作得很好。在这两种情况下,我都使用pip中的eventbrite==3.0.2 (其他版本表现出类似的行为)
$ python
Python 2.7.9 (default, Apr 24 2015, 22:50:46)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import eventbrite
>>> oauth_token = 'MY_TOKEN'
>>> eventbrite = eventbrite.Eventbrite(oauth_token)
>>> data = dict(city='San Francisco', since_id=16991295422)
>>> num_events = eventbrite.get('/events/search', data=data)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/eventbrite/decorators.py", line 20, in wrapper
raise InternetConnectionError(e)
eventbrite.exceptions.InternetConnectionError: ('Connection aborted.', ResponseNotReady())我知道这里涉及到重定向,这会是原因吗?
发布于 2015-06-21 00:46:06
这与Azure无关。我配置了另一台服务器,它工作得很好。因此,很可能是eventbrite API阻止了该IP。不过,在eventbrite API人员回复我发送给他们的电子邮件之前,我无法确认这一点:)
https://stackoverflow.com/questions/30549882
复制相似问题