Page MenuHomePhabricator

wikidataquery_tests.TestApiSlowFunctions.testQueryApiGetter fails for python 3.4
Closed, DeclinedPublic


With python 3.4 wikidataquery_tests.TestApiSlowFunctions.testQueryApiGetter fails for an unexpected keyword argument 'buffering':

4012ERROR: testQueryApiGetter (tests.wikidataquery_tests.TestApiSlowFunctions)
4013Test that we can actually retreive data and that caching works.
4015Traceback (most recent call last):
4016  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/requests/packages/urllib3/", line 385, in _make_request
4017    httplib_response = conn.getresponse(buffering=True)
4018TypeError: getresponse() got an unexpected keyword argument 'buffering'


Event Timeline

As mentioned in this is an error of a ReadTimeout rather than the TypeError.

Hence, this is probably non-deterministic because of a slow internet connection or a network timeout ?

The last exception of the exceptions tree is raise ReadTimeout(e, request=request) :

4071  File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/comms/", line 331, in _http_process
4072    verify=not ignore_validation)
4073  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/requests/", line 475, in request
4074    resp = self.send(prep, **send_kwargs)
4075  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/requests/", line 585, in send
4076    r = adapter.send(request, **kwargs)
4077  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/requests/", line 479, in send
4078    raise ReadTimeout(e, request=request)
4079requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='', port=443): Read timed out. (read timeout=30)

which should be handled by pywikibot.comms.http:

def _http_process(session, http_request):
        response = session.request(method, uri, data=body, headers=headers,
                                   auth=auth, timeout=timeout,
                                   verify=not ignore_validation)
    except Exception as e: = e
    else: = response

But it didn't?

This appears to be the problem raised as

It looks like this has been solved Upstream in urllib3, at

It could take a while for that bugfix in urllib3 to be vendored into a requests release.

@Xqt, _http_process did handle it. = e was done, and that causes it to be re-raised later.

Might be this one is caused by the other.

Multichill added a subscriber: Multichill.

Functionality was removed in T162585 . Declining this one.