Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

allow newer version of requests #186

Merged
merged 4 commits into from
Oct 14, 2014
Merged

Conversation

stesla
Copy link
Contributor

@stesla stesla commented Oct 14, 2014

It appears that the requests library had some python3 compatibility issues that
were fixed between version 1.1.0 and the current version.

This fixes the following error when I actually try to make a request from the API using python3:

$ evelink eve.EVE.character_id_from_name "Stewart Cash"
APIResult(result=1759081950, timestamp=1413306683, expires=1415985083)
[stesla@WUD-STESLA03:~/Projects/evelink (master=)]$ rm ~/.evelink_cache 
[stesla@WUD-STESLA03:~/Projects/evelink (master=)]$ evelink eve.EVE.character_id_from_name "Stewart Cash"
Traceback (most recent call last):
  File "/home/stesla/Projects/evelink/bin/evelink", line 108, in call_evelink_api
    result = method_obj(*args, **kwargs)
  File "/home/stesla/Projects/evelink/evelink/eve.py", line 139, in character_id_from_name
    api_result = self.character_ids_from_names([name])
  File "/home/stesla/Projects/evelink/evelink/api.py", line 503, in wrapper
    kw['api_result'] = client.api.get(self.path, params=params)
  File "/home/stesla/Projects/evelink/evelink/api.py", line 258, in get
    response, robj = self.send_request(full_path, params)
  File "/home/stesla/Projects/evelink/evelink/api.py", line 308, in send_request
    return self.requests_request(full_path, params)
  File "/home/stesla/Projects/evelink/evelink/api.py", line 356, in requests_request
    r = session.post(full_path, data=params)
  File "/home/stesla/local/python-3.4.1/lib/python3.4/site-packages/requests/sessions.py", line 340, in post
    return self.request('POST', url, data=data, **kwargs)
  File "/home/stesla/local/python-3.4.1/lib/python3.4/site-packages/requests/sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "/home/stesla/local/python-3.4.1/lib/python3.4/site-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/home/stesla/local/python-3.4.1/lib/python3.4/site-packages/requests/adapters.py", line 174, in send
    timeout=timeout
  File "/home/stesla/local/python-3.4.1/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 417, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/home/stesla/local/python-3.4.1/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 232, in _get_conn
    return conn or self._new_conn()
  File "/home/stesla/local/python-3.4.1/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 547, in _new_conn
    strict=self.strict)
TypeError: __init__() got an unexpected keyword argument 'strict'

Pleasantly, this seems to wrap up the fixes to get the evelink script working under python3. I've been able to poke at several API end points with it successfully now.

It appears that the requests library had some python3 compatibility issues that
were fixed between version 1.1.0 and the current version.
@ayust
Copy link
Member

ayust commented Oct 14, 2014

Hm - would it be reasonable to also modify the Python 2.x requirements file to pull in requests upgrades?

@stesla
Copy link
Contributor Author

stesla commented Oct 14, 2014

They are still maintaining Python 2.7 compatibility, so I can't see why not (indeed, their latest release explicitly includes improvements under 2.7). Do you just want me to bump it up to >=2.4.3 for both?

@ayust
Copy link
Member

ayust commented Oct 14, 2014

Do you know if they still have Python 2.6 compat? If yes, it's an easy bump; if no I'll need to make a call on whether to keep supporting Python 2.6 in EVELink.

@ayust
Copy link
Member

ayust commented Oct 14, 2014

Judging from the patch notes on https://pypi.python.org/pypi/requests it seems like they're still fixing bugs that stemmed from 2.6, so I'm guessing they're still compatible. Let's go ahead and bump both to >=2.0.0 - that'll still pick up the latest versions if available for now.

@stesla
Copy link
Contributor Author

stesla commented Oct 14, 2014

Their website says 2.6-3.4, so there you go. :)

@stesla
Copy link
Contributor Author

stesla commented Oct 14, 2014

Bah, hang on, lemme roll that back to >=2.0.0. I missed that email.

ayust added a commit that referenced this pull request Oct 14, 2014
Move to using requests 2.0.0 or higher.
@ayust ayust merged commit 2d9bcb7 into eve-val:master Oct 14, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants