V
V
Vladisus2015-05-25 22:27:28
Python
Vladisus, 2015-05-25 22:27:28

Error when using api vk, what is it?

import vk
import time

vkapi = vk.API(
    user_login='***', user_password='***', app_id='***')

url = 'http://www.twitter.com'

sids = []

posts = vkapi.newsfeed.search(q=url)
for item in posts['items']:
    sids.append(item['owner_id'])

for pk in sids:
    if pk >= 1:
        print(vkapi.users.get(user_id=pk))
        time.sleep(.3)
    else:
        print(vkapi.groups.getById(group_id=abs(pk)))
        time.sleep(.3)

When executing the code, sometimes an error occurs:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 409, in _make_request
    httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'

What is it and why does it appear?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladisus, 2015-05-25
@Vladisus

Found on stackoverflow

V
Vadim Yakovlev, 2015-05-25
@1nn0

Invalid argument for urllib3 getresponse() method.
I would venture to suggest that somewhere in the vk module this construction is used and it is not allowed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question