Issue #31 resolved

ssl-cat.py fails to run

Anonymous created an issue

Running scripts/ssl-cat.py with valid arguments causes a TypeError exception.

This is with python 2.6 (running on RedHat Enterprise 6).

For example:

$ python ssl-cat.py -p 7000 example.com foobot somechannel

Traceback (most recent call last): File "ssl-cat.py", line 76, in <module> main() File "ssl-cat.py", line 63, in main connect_factory=ssl_factory, File "/usr/lib/python2.6/site-packages/irc/functools.py", line 35, in wrapper return method(self, args, *kwargs) File "/usr/lib/python2.6/site-packages/irc/client.py", line 488, in connect self.socket = self.connect_factory(self.server_address) File "/usr/lib/python2.6/site-packages/irc/connection.py", line 60, in connect sock.bind(self.bind_address) File "<string>", line 1, in bind TypeError: getsockaddrarg: AF_INET address must be tuple, not function

Comments (2)

  1. Nick Raptis

    Confirmed on python 2.7 with identical traceback.

    Actually, the library is ok, it's that ssl-cat.py doesn't call irc.connection.Factory the right way.

    scripts/ssl-cat.py line 56 calls

        ssl_factory = irc.connection.Factory(ssl.wrap_socket)
    

    when it should be

        ssl_factory = irc.connection.Factory(wrapper=ssl.wrap_socket)
    

    resulting in the wrapper being assigned to the bind_address


    Made a pull request with the fix https://bitbucket.org/jaraco/irc/pull-request/22/fix-factory-call-in-ssl-example-script/diff

    Too bad it's only a one-liner :)

  2. Log in to comment