sookasa / box.py

Python client for Box
43 stars 25 forks source link

Long Poll Error #21

Closed mrbirl closed 10 years ago

mrbirl commented 10 years ago

Using the example code provided here, I am attempting to test the long poll functionality. I keep getting the following error:

Traceback (most recent call last):
  File "box_long_poll.py", line 5, in <module>
    position = client.long_poll_for_events() # this will block until there are new events
  File "/usr/local/lib/python2.7/dist-packages/box/client.py", line 694, in long_poll_for_events
    stream_position = cursor['next_stream_position']
TypeError: 'Response' object has no attribute '__getitem__'
tals commented 10 years ago

Ooops, it's a recent regression. I don't use the library at all and the test was lacking, which is how it slipped in the first place.

Fixed in b42b958f11. Thanks for reporting.

mrbirl commented 10 years ago

Great stuff, thanks for the quick fix.