unwitting / bitstampy

Bitstamp API wrapper for Python
MIT License
55 stars 21 forks source link

problem with bytes, bytearray ans str #8

Closed amnonmel closed 8 years ago

amnonmel commented 8 years ago

Hi, Tried to run the code on python3, and got this stacktrace. It appears to be a python3 compatability issue - the code runs perfectly on python2 Thankyou

Traceback (most recent call last): File "tr5.py", line 158, in bitstamp_USD_balance=bitstamp_balance(bs_c=bs_c, bs_k=bs_k, bs_s=bs_s, asset="usd_available") File "tr5.py", line 61, in bitstamp_balance bs_data=api.account_balance(bs_c, bs_k, bs_s) File "/home/ubuntu/btc/installstuff/bitstampy/bitstampy/api.py", line 40, in account_balance calls.APIAccountBalanceCall(client_id, api_key, api_secret) File "/home/ubuntu/btc/installstuff/bitstampy/bitstampy/calls.py", line 81, in call self.api_secret, msg=message, digestmod=hashlib.sha256) File "/usr/lib/python3.4/hmac.py", line 144, in new return HMAC(key, msg, digestmod) File "/usr/lib/python3.4/hmac.py", line 42, in init raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).name) TypeError: key: expected bytes or bytearray, but got 'str'

unwitting commented 8 years ago

Hi! Thanks for raising, but at the moment I don't have the inclination to make this library work with Python 3, I designed it with 2... I think I'll close the issue as a wontfix, but if anyone out there feels like trying their hand at a Python 3 fork I'll gladly pull it :D