This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fgsch
Recipients
Date 2004-08-31.16:18:01
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
hi,

  first, background:

  OS: OpenBSD-current/i386
  Python version: 2.3.4

   example script:

import socket

socket.setdefaulttimeout(30)

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 9999))

   where nothing is listening on 9999 (ECONNREFUSED
should be returned).
   when ran it i get:

Traceback (most recent call last):
  File "bug.py", line 8, in ?
    s.connect(('127.0.0.1', 9999))
  File "<string>", line 1, in connect
socket.error: (22, 'Invalid argument')

  this is a problem in the socketmodule.c, in the
internal_connect() function. getsockopt with SOCK_ERROR
should be used once EINPROGRESS is returned to get the
real error.
  this code works on linux, but the connect semantic
is, imho, broken. you cannot reuse a socket once it
failed (a test afterwards shown that this is valid
under linux!!!!).
  please contact me if you need further details,
although i find this very clear.
  thanks,

  f.-
History
Date User Action Args
2007-08-23 14:25:53adminlinkissue1019808 messages
2007-08-23 14:25:53admincreate