Skip to content
This repository has been archived by the owner on Aug 9, 2018. It is now read-only.

unicode objects must be encoded #10

Closed
vantessel opened this issue Jun 29, 2017 · 3 comments
Closed

unicode objects must be encoded #10

vantessel opened this issue Jun 29, 2017 · 3 comments

Comments

@vantessel
Copy link

vantessel commented Jun 29, 2017

maybe it's just me but:
from bitstampy import api
c='999999'
k='xXx'
s=b'xXx'
api.account_balance(c, k, s)

and I get the error:
TypeError: Unicode-objects must be encoded before hashing
on pyhton 3.4

@zlwolf236
Copy link

I got the same error, have been spending 2 days on this, hope somebody can help. Very much appreciated

@zlwolf236
Copy link

this is solved (clean or not clean). I hardcoded the code in hmac.py with this substitution

def update(self, msg):
    """Update this hashing object with the string msg.
    """


    #Two line below were hardcoded
    msg = bytearray(str(msg), 'utf-8')
    print(type(msg))

    self.inner.update(msg)

@unwitting
Copy link
Owner

Hi - is there any reason you're using a byte string for the secret key? I have a feeling that might be causing this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants