[ python-Bugs-1476111 ] SystemError in socket sendto

SourceForge.net noreply at sourceforge.net
Tue Apr 25 17:08:51 CEST 2006

Bugs item #1476111, was opened at 2006-04-25 15:02
Message generated for change (Comment added) made by twouters
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: CyDefect (cydefect)
>Assigned to: Thomas Wouters (twouters)
Summary: SystemError in socket sendto

Initial Comment:
A socket's sendto method can be tricked into a
SystemError exception. This happens with:

Linux special 2.4.29 #19 Thu Jan 27 20:51:25 CET 2005
i686 unknown
Python 2.4.2 (#2, Dec 27 2005, 11:06:14)

Linux vesuv6 2.4.20-4GB #1 Mon Mar 17 17:54:44 UTC 2003
i686 unknown unknown GNU/Linux
Python 2.3.3 (#1, Jun 29 2004, 14:43:40)
[GCC 3.3 20030226 (prerelease) (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.

shows the same behaviour.

These 4 lines demonstrate the failure:
import socket
s = socket.socket( socket.PF_PACKET, socket.SOCK_RAW,
0x0003 ) )
s.sendto( "abc", 0, range( 6 ) )


Traceback (most recent call last):
  File "serr.py", line 7, in ?
    s.sendto( "abc", 0, range( 6 ) )
SystemError: new style getargs format but argument is
not a tuple



>Comment By: Thomas Wouters (twouters)
Date: 2006-04-25 17:08

Logged In: YES 

Well, 'tricked' is a bit of a big word; it just means you
passed the wrong type of address; AF_PACKET expects a tuple
(of string+int or int+int+string), and not a list. It didn't
have any ill effects (other than confusing the programmer.)
I fixed the errormessage for AF_PACKET (and AF_INET6, which
was also missing) in trunk revision 45714 (so it'll be in
2.5 alpha 2.) Thanks!


You can respond by visiting: 

More information about the Python-bugs-list mailing list