-
Notifications
You must be signed in to change notification settings - Fork 0
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
1.0.2 support. Python 3 endode / decode problems fixed #1
base: master
Are you sure you want to change the base?
Conversation
Tested - this works for me. Let's get it merged. |
Actually just found an issue:
The issue is with The fix: content_type = r.headers.get('content-type')
if not content_type:
content_type = b'' If we remove the |
path = url.path | ||
if url.query: | ||
path = path + '?' + url.query | ||
|
||
string_to_sign = '%s,%s,%s,%s,%s' % (method, content_type, content_md5, path, httpdate) | ||
digest = hmac.new(self.secret_key, string_to_sign, hashlib.sha1).digest() | ||
string_to_sign = '%s,%s,%s,%s,%s' % (method, content_type.decode(), content_md5, path, httpdate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to take care the empty content-type case.
if not content_type:
content_type = ''
Error:
http: error: AttributeError: 'str' object has no attribute 'decode'
Change line 23 to content_type = b''
After fixing it let's release it |
This lets people use Python3, and newer versions of httpie. maybe.