{"action":"closed","issue":{"url":"https://api.github.com/repos/tgalal/yowsup/issues/1002","labels_url":"https://api.github.com/repos/tgalal/yowsup/issues/1002/labels{/name}","comments_url":"https://api.github.com/repos/tgalal/yowsup/issues/1002/comments","events_url":"https://api.github.com/repos/tgalal/yowsup/issues/1002/events","html_url":"https://github.com/tgalal/yowsup/issues/1002","id":101251250,"number":1002,"title":"Python3: Generating axolotl key fails ? ","user":{"login":"ThomasRgbg","id":10013693,"avatar_url":"https://avatars.githubusercontent.com/u/10013693?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasRgbg","html_url":"https://github.com/ThomasRgbg","followers_url":"https://api.github.com/users/ThomasRgbg/followers","following_url":"https://api.github.com/users/ThomasRgbg/following{/other_user}","gists_url":"https://api.github.com/users/ThomasRgbg/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasRgbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasRgbg/subscriptions","organizations_url":"https://api.github.com/users/ThomasRgbg/orgs","repos_url":"https://api.github.com/users/ThomasRgbg/repos","events_url":"https://api.github.com/users/ThomasRgbg/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasRgbg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-16T10:39:12Z","updated_at":"2015-08-27T07:07:38Z","closed_at":"2015-08-27T07:07:38Z","body":"I just ported my scripts to python3 (3.2), but now the key generation fails. Starting the sam script with Python 2.7 works. \r\n\r\n```\r\n\r\n12:32:11 DEBUG:yowsup.layers.logger.layer:receive:rx:\r\n<success status=\"active\" kind=\"free\" creation=\"1421686494\" expiration=\"1453222494\" props=\"4\" t=\"1439721130\">\r\n©ÆeÁ▒:jÞ}Pwi$\r\nHEX3:b'a9c665c18813183a6ade1f7d5093877769240508'\r\n</success>\r\n\r\n12:32:11 DEBUG:yowsup.layers.protocol_iq.layer:onEvent:starting ping thread.\r\n12:32:11 INFO:yowsup.layers.axolotl.layer:onEvent:Axolotl layer is generating keys\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/wa_user.py\", line 114, in <module>\r\n    stack.loop(timeout=2, count=1) # Let the taskloop run one time for 2 seconds \r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/stacks/yowstack.py\", line 175, in loop\r\n    asyncore.loop(*args, **kwargs)\r\n  File \"/usr/lib/python3.2/asyncore.py\", line 220, in loop\r\n    poll_fun(timeout, map)\r\n  File \"/usr/lib/python3.2/asyncore.py\", line 156, in poll\r\n    read(obj)\r\n  File \"/usr/lib/python3.2/asyncore.py\", line 87, in read\r\n    obj.handle_error()\r\n  File \"/usr/lib/python3.2/asyncore.py\", line 83, in read\r\n    obj.handle_read_event()\r\n  File \"/usr/lib/python3.2/asyncore.py\", line 449, in handle_read_event\r\n    self.handle_read()\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/network/layer.py\", line 73, in handle_read\r\n    self.receive(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/network/layer.py\", line 80, in receive\r\n    self.toUpper(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/stanzaregulator/layer.py\", line 28, in receive\r\n    self.processReceived()\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/stanzaregulator/layer.py\", line 48, in processReceived\r\n    self.toUpper(oneMessageData)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/auth/layer_crypt.py\", line 63, in receive\r\n    self.toUpper(payload)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/coder/layer.py\", line 35, in receive\r\n    self.toUpper(node)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/logger/layer.py\", line 14, in receive\r\n    self.toUpper(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/axolotl/layer.py\", line 112, in receive\r\n    self.toUpper(protocolTreeNode)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 55, in toUpper\r\n    self.__upper.receive(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 160, in receive\r\n    s.receive(data)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 101, in receive\r\n    recv(node)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/auth/layer_authentication.py\", line 59, in handleSuccess\r\n    self.broadcastEvent(successEvent)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 168, in subBroadcastEvent\r\n    self.broadcastEvent(yowLayerEvent)\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/__init__.py\", line 72, in broadcastEvent\r\n    if self.__lower and not self.__lower.onEvent(yowLayerEvent):\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/axolotl/layer.py\", line 82, in onEvent\r\n    self.sendKeys()\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/axolotl/layer.py\", line 280, in sendKeys\r\n    preKeysDict[self.adjustId(preKey.getId())] = self.adjustArray(keyPair.getPublicKey().serialize()[1:])\r\n  File \"/usr/local/lib/python3.2/dist-packages/yowsup2-2.3.185-py3.2.egg/yowsup/layers/axolotl/layer.py\", line 352, in adjustId\r\n    return binascii.unhexlify(_id)\r\nTypeError: 'str' does not support the buffer interface\r\n```\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/25821726-python3-generating-axolotl-key-fails?utm_campaign=plugin&utm_content=tracker%2F298781&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F298781&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}