[Twisted-Python] Twisted.bugs ate my balls!

Andrew Bennetts andrew-twisted at puzzling.org
Mon May 27 05:46:47 EDT 2002


libpq.OperationalError: ERROR: value too long for type character varying(16)
...
("INSERT INTO bugs_items\n (submittor_name, submittor_email, assigned,
date_submitted, date_modified,\n version, os, security, type, status,
summary, description) VALUES\n (%s, %s, NULL, now(), now(), %s, %s, %s, %s,
'open', %s, %s)\n ", 'Andrew Bennetts', 'andrew-twistedbugs at puzzling.org',
'0.18.0-prerelease', 'Win32', 'f', 'normal', 'connectionFailed might not get
called', 'On Win32, connecting to a closed port doesn\'t fail immediately,
but instead only calls connectionFailed after timing out. However, timeouts
are optional, so it is possible it will never be called.\r\n\r\nFor the
default (select) reactor, the problem is winsock\'s select reports failed
connections as "exceptional", rather than as readable/writeable, and Twisted
ignores exceptional socket events.\r\n\r\nPerhaps if platform is win32, do
something like:\r\n\r\ndef win32select(reads, writes, ignored,
timeout=None):\r\n """Kludge around winsock\'s select() function"""\r\n r,
w, e = select.select(reads, writes, reads, timeout)\r\n return r+e, w,
[]\r\nselect = win32select')

*sigh*

It turns out Itamar has submitted the same bug:
    http://www.twistedmatrix.com/users/itamarst.twistd/bugs/view_bug?bug_id=19
    
Anyway, bug I'm trying to submit reads:

Summary: 
    connectionFailed might not get called

Description:
    On Win32, connecting to a closed port doesn't fail immediately, but
    instead only calls connectionFailed after timing out.  However, timeouts
    are optional, so it is possible it will never be called.

    For the default (select) reactor, the problem is winsock's select
    reports failed connections as "exceptional", rather than as
    readable/writeable, and Twisted ignores exceptional socket events.

    Perhaps if platform is win32, do something like:

    def win32select(reads, writes, ignored, timeout=None):
        """Kludge around winsock's select() function"""
        r, w, e = select.select(reads, writes, reads, timeout)
        return r+e, w, []
    select = win32select





More information about the Twisted-Python mailing list