Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't pin requests to a specific broken version #51

Closed
johnrfrank opened this issue Jan 4, 2016 · 8 comments
Closed

don't pin requests to a specific broken version #51

johnrfrank opened this issue Jan 4, 2016 · 8 comments

Comments

@johnrfrank
Copy link

Was there a reason to pin requests==2.8.1 instead of the much friendlier "<=2.8.1"?

That version of requests pulls in a broken version of urllib3 that cannot do SSL properly, so we have had to pin "requests<=2.7.0". Since you pinned to that specific version of requests, I have to also say:

    'gensim <= 0.12.1', # so it doesn't pull in smart-open newest that pins requests to 2.8.1
    'smart-open < 1.3.1', # yuck.
    'requests', # <= 2.7.0', # pinned until this is released: https://github.com/shazow/urllib3/issues/717

If you used "requests<=2.8.1" then everything would work fine... unless you have some need of 2.8.1 specifically in smart-open?

@tmylk
Copy link
Contributor

tmylk commented Jan 4, 2016

That's a httpretty requirement 2.8.1 so we need it to run tests.

@johnrfrank
Copy link
Author

I looked in HTTPretty to figure out if they can fix it there, and they have a requirements.txt file that says:

HTTPretty doesn't have any requirements per se so far. yay!

so.... where is requests==2.8.1 required? :-)

@tmylk
Copy link
Contributor

tmylk commented Jan 5, 2016

See development.txt file

Would really appreciate if you could make httpretty work on Python 2 and 3 with later request!

@piskvorky
Copy link
Owner

@tmylk not sure I understand. Why are we pulling in httpretty's development.txt file? Or even its requirements.txt file? How is it smart_open's business what libraries httpretty needs or doesn't need?

@tmylk
Copy link
Contributor

tmylk commented Jan 5, 2016

An error is generated by httpretty when it is used with requests later version.
I will post it this weekend.

@tmylk
Copy link
Contributor

tmylk commented Jan 5, 2016

@piskvorky
This is resolved by fixing the requests version.
This was not an issue in previous version of httpretty so I assume httpretty is the culprit.
Httpretty is developed with requests 2.8.1 version fixed.

======================================================================
ERROR: test_write (smart_open.tests.test_smart_open.WebHdfsWriteTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 3, in wrapper
  File "/home/travis/build/piskvorky/smart_open/smart_open/tests/test_smart_open.py", line 463, in test_write
    smart_open_object.close()
  File "/home/travis/build/piskvorky/smart_open/smart_open/smart_open_lib.py", line 560, in close
    self.upload(buff)
  File "/home/travis/build/piskvorky/smart_open/smart_open/smart_open_lib.py", line 523, in upload
    response = requests.post(uri, data=data, headers={'content-type': 'application/octet-stream'})
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/requests/api.py", line 107, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/requests/api.py", line 53, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/requests/sessions.py", line 454, in request
    prep = self.prepare_request(req)
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/requests/sessions.py", line 388, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/requests/models.py", line 296, in prepare
    self.prepare_body(data, files, json)
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/requests/models.py", line 447, in prepare_body
    body = self._encode_params(data)
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/requests/models.py", line 84, in _encode_params
    return to_native_string(data)
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/requests/utils.py", line 700, in to_native_string
    out = string.decode(encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 0: ordinal not in range(128)

@tmylk
Copy link
Contributor

tmylk commented Jan 17, 2016

Apologies, I have incorrectly assumed you were asking for a later version of requests, but now I realise you wanted to use an older one.

This is relaxed and merged in in #57.

If you could report back if it fixes the issue for you that would be greatly appreciated.

@tmylk
Copy link
Contributor

tmylk commented Oct 5, 2016

Requests are no longer pinned.
Closing as abandoned.

@tmylk tmylk closed this as completed Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants