Closed GoogleCodeExporter closed 9 years ago
Mmm... I'm not sure I like the hasattr() check. I would first investigate into
why circus uses _socket.socket rather than socket.socket, which is kind of
unusual, and possibly fix this in circus.
I have seen Tarek (author of circus) at Euro Python. I guess I can ask him
directly. =)
More later.
Original comment by g.rodola
on 3 Jul 2013 at 12:27
It's not circus that uses _socket.socket, it is the socket module.
_socket.socket is what is returned by socket.fromfd().
hasattr is pretty standard duck typing, we want to listen() using the
object passed in, so make sure it is capable of listen()ing...
Original comment by btimby@gmail.com
on 3 Jul 2013 at 7:35
[deleted comment]
Some I frequently do is like this...
if callable(getattr(address_or_socket, 'listen', None)):
...
To make sure listen is a method and not another type of attribute.
Original comment by btimby@gmail.com
on 4 Jul 2013 at 1:13
Any more feedback?
Original comment by btimby@gmail.com
on 11 Jul 2013 at 5:19
It looks like socket.fromfd() started returning a socket.socket instance
starting from Python 3.3 while on Python 2.7 we still get socket._socket.
Please go ahead and apply your initial patch.
Original comment by g.rodola
on 12 Jul 2013 at 10:22
I committed a fix:
http://code.google.com/p/pyftpdlib/source/detail?r=1230
Original comment by btimby@gmail.com
on 16 Jul 2013 at 4:08
Original comment by g.rodola
on 6 Nov 2013 at 8:31
Original comment by g.rodola
on 8 Nov 2013 at 7:52
Original issue reported on code.google.com by
btimby@gmail.com
on 2 Jul 2013 at 2:16Attachments: