On Fri, 12 Jan 2007 05:54:42 GMT, John Nagle <[EMAIL PROTECTED]> wrote: >Heikki Toivonen wrote: >> [EMAIL PROTECTED] wrote: >> >>> That's a problem for me. I need short timeouts; I'm accessing sites >>>that might or might not have SSL support, and I need to quickly time >>>out when there's no SSL server. >> >> >> You should be able to do short timeouts, just not using the global >> setdefaulttimeout. Have you tried Connection.set_socket_read/write_timeout? > > Yes. That does not affect the connect timeout; it's only effective once >the connection has been opened. And adjusting the session timeout >just recreates the blocking/non blocking problem. > > Incidentally, "get_socket_read_timeout()" doesn't work. Generates >"EXCEPTION at socket level: unpack str size does not match format", >every time, at least with Python 2.4 on Windows. The lower level >function returns one number as a string, like "7200", and the unpack >function tries to unpack it as "ll", which fails. > >> Also like I mentioned before, if you use the Twisted wrapper and let >> Twisted handle network stuff you should be fine. > > That would mean struggling with Twisted and dealing with its bugs. >(For example, has the MySQLdb mess been resolved for Twisted's API?)
http://twistedmatrix.com/trac/search?q=MySQLdb&noquickjump=1&ticket=on I'd say so, unless you're referring to a bug you never reported (we only fix those at about half the rate of reported bugs). Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list