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

Fix hash method to work with python3 #1443

Closed
wants to merge 1 commit into from
Closed

Conversation

antlarr
Copy link

@antlarr antlarr commented Feb 25, 2018

Description

In python3, unicode objects have to be encoded before being
hashed with hashlib so this commit fixes the hash method so
it works with both python2 and python3.

How to test

I run mycroft-core with python3 and saw an exception being raised:
TypeError: Unicode-objects must be encoded before hashing
After applying this commit, it works successfully.

Contributor license agreement signed?

CLA [yes] (Whether you have signed a CLA - Contributor Licensing Agreement

In python3, unicode objects have to be encoded before being
hashed with hashlib so this commit fixes the hash method so
it works with both python2 and python3.
@forslund
Copy link
Collaborator

Hi @antlarr, thanks for the PR. We've prepared a bunch of fixes for python 3 in the 18.02 branch. Can you check that the issue remains in there? and in that case resubmit for that branch?

@antlarr
Copy link
Author

antlarr commented Feb 26, 2018

Ah, I noticed the python3 branch (which is very old) but not that 18.02 branch. When is it planned to be merged to dev ?

@antlarr
Copy link
Author

antlarr commented Feb 26, 2018

Btw, the issue is fixed in the 18.02 branch. Great. Althought for python3 to work, the skillls need also to support python3 with fixes such as MycroftAI/fallback-wolfram-alpha#11

@penrods
Copy link
Contributor

penrods commented Feb 26, 2018

Yes, before 18.02 we have officially supported Python 2.7 only. With 18.02 we are jumping to Python 3 for mycroft-core. And yep, as a result we will need to update several skills that fall under our control.

Thanks for verifying!

@penrods penrods closed this Feb 26, 2018
@antlarr antlarr deleted the python3 branch February 26, 2018 20:08
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.

None yet

3 participants