Fix two python3 compatibility problems:

We need to explicitly encode the serverID before hashing it
Pass read/binary modes to the file made from socket to avoid encoding problems, fixes #29
This commit is contained in:
Ammar Askar committed 2015-04-17 17:57:34 +05:00
1 parent 9202c4399b
commit 79ee31c44e
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -138,7 +138,7 @@ class Connection(object):
# the server.
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.connect((self.options.address, self.options.port))
self.file_object = self.socket.makefile()
self.file_object = self.socket.makefile("rb")
def _handshake(self, next_state=2):
handshake = packets.HandShakePacket()