-
-
Notifications
You must be signed in to change notification settings - Fork 420
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
'TypeError: buf must be a byte string' using Python 2 #161
Comments
Python 2 is fine and if its caused by requests oauthlib or oauthlib we will fix it. Not sure I can reproduce from the trace alone, can you please include instructions for reproducing and/or logging output for both the 'oauthlib' and 'requests-oauthlib' namespace. Cheers! |
This is the code that did it https://github.com/sympy/sympy/blob/8cd27ddecec7f275f20b0d4d35ba16071eb5216b/release/fabfile.py#L1269 |
+1 ran into the same issue on Python 2.6 |
Removing |
Had the same problem with Python 2.7 on Ubuntu 14.04 LTS. |
@cosimo as @ib-lundgren pointed out. It's difficult to reproduce this by traceback alone. Can you provide more context to help repro this? |
I can start from the SSL error and trace my steps back, but I have no clear idea of what might be the underlying issue. |
In Python 2, I keep getting
I debugged, and I am pretty sure it is coming from requests-oauthlib, which converts the body into a unicode string somewhere when it does its thing with the OAuth2 token (it could also be oauthlib, I haven't debugged that much). The only way I could work around it was to edit that SSL.py and make it encode the buf instead of raising an exception (I would use Python 3 except I have a hard dependency on fabric which doesn't support it yet).
I looked and requests-oauthlib and oauthlib are both making heavy use of
from __future__ import unicode_literals
, which if I had to guess, is probably the source of the problem.The text was updated successfully, but these errors were encountered: