[Python-Dev] Cryptic error messages

Michael Hudson mwh21@cam.ac.uk
01 Dec 2000 11:20:23 +0000


Ka-Ping Yee <ping@lfw.org> writes:

> An attempt to use sockets for the first time yesterday left a
> friend of mine bewildered:
> 
>     >>> import socket
>     >>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>     >>> s.connect('localhost:234')
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in ?
>     TypeError: 2-sequence, 13-sequence
>     >>> 
> 
> "What the heck does '2-sequence, 13-sequence' mean?" he rightfully asked.
> 

I'm not sure about the general case, but in this case you could do
something like:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102599&group_id=5470

Now you get an error message like:

TypeError: getsockaddrarg: AF_INET address must be tuple, not string

Cheers,
M.

-- 
  I have gathered a posie of other men's flowers, and nothing but the
  thread that binds them is my own.                       -- Montaigne