abrihter / duxwrap

Dux Soup remote control API wrapper
MIT License
2 stars 1 forks source link

Python 3? #1

Closed mrjcleaver closed 4 years ago

mrjcleaver commented 4 years ago

Hi, I see: ('DuxSoup version:', '0.6') Traceback (most recent call last): File "lambda_function.py", line 9, in <module> profile_data = dux.call("profile", {}) File "/home/mrjcleaver/dux-lambda/package/duxwrap/duxwrap.py", line 226, in call return self._request_send(command, request_data) File "/home/mrjcleaver/dux-lambda/package/duxwrap/duxwrap.py", line 175, in _request_send sig = self._create_signature_type(command, request) File "/home/mrjcleaver/dux-lambda/package/duxwrap/duxwrap.py", line 119, in _create_signature_type return self._create_signature(signature_data) File "/home/mrjcleaver/dux-lambda/package/duxwrap/duxwrap.py", line 100, in _create_signature mac = hmac.new(bytes(self.api_key, 'ascii'), digestmod=hashlib.sha1) TypeError: str() takes at most 1 argument (2 given) for your code: mac = hmac.new(bytes(self.api_key, 'ascii'), digestmod=hashlib.sha1) message = bytes(data, 'ascii') mac.update(message) sig = mac.digest() return str(base64.b64encode(sig), encoding='ascii', errors='strict')

Is this because I'm running Python 3? Looks a bit like https://github.com/miotto/treetagger-python/issues/11#issuecomment-254961754

abrihter commented 4 years ago

This should not be issue on python3

Look like you are running it on python2 but I cant be sure without additional info and some example that I can run locally

mrjcleaver commented 4 years ago

Ha ha, you are so right! Thanks :)