-
Notifications
You must be signed in to change notification settings - Fork 358
TcpHandle: TCP connection port parse error #32
Comments
Hmm, |
Hi, its tested `class TcpHandle(object):
def init(self, serial):
You can easy tell, that the line |
Sorry just seen, that the default path have to covered as well `
def init(self, serial):
` |
Hi @thica ! In fact >>> socket.create_connection(('127.0.0.1', '12800'))
<socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 39774), raddr=('127.0.0.1', 12800)>
>>> socket.create_connection(('127.0.0.1', 12800))
<socket.socket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 39778), raddr=('127.0.0.1', 12800)> So we do not need to cast |
Hi checked it out, you are right. I am running on an error, as all my strings in my app are unicode, which can't be handled by socket. |
You'll need to encode the port as bytes before passing it to TcpHandle then: |
In common.py, you split (in init of TcpHandle) the given serial (which in effect is host:port). port results as a string, but socket expects port to be numeric in socket.create_connection
Python 2.7
The text was updated successfully, but these errors were encountered: