Skip to content

signature now returns native type for both python2 and python3#181

Merged
dougblack merged 1 commit into
twilio:masterfrom
hwayne:fix-python3-validator
Oct 13, 2014
Merged

signature now returns native type for both python2 and python3#181
dougblack merged 1 commit into
twilio:masterfrom
hwayne:fix-python3-validator

Conversation

@hwayne
Copy link
Copy Markdown

@hwayne hwayne commented Sep 13, 2014

I ran into a bug where the validator would always return false in python3. I noticed the compute_signature method uses base64, which returns a bytecode string. Python3 uses unicode strings as default instead, and the two always compare to false. This pull request should fix that.

Summary of Changes

  • Added extra parameter utf to compute_signature, which defaults to True in python3 and False in python2
  • If utf is True then computed will be coerced to a unicode string
  • Added tests to cover both versions.

All tests pass in both python2 and python3, returns the native stringtype for both in interactive prompt, happy to do other checks if needed.

@phalt
Copy link
Copy Markdown
Contributor

phalt commented Oct 2, 2014

+1

1 similar comment
@dougblack
Copy link
Copy Markdown
Contributor

+1

dougblack added a commit that referenced this pull request Oct 13, 2014
signature now returns native type for both python2 and python3
@dougblack dougblack merged commit 1d56e0f into twilio:master Oct 13, 2014
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

Successfully merging this pull request may close these issues.

3 participants