[Checkins] [zopefoundation/zope.server] 5ebec8: A better fix for #2

GitHub noreply at github.com
Sun Nov 8 14:29:27 CET 2015


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.server
  Commit: 5ebec88fc8ab3687b83b182a8769af249ff876cc
      https://github.com/zopefoundation/zope.server/commit/5ebec88fc8ab3687b83b182a8769af249ff876cc
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2015-11-08 (Sun, 08 Nov 2015)

  Changed paths:
    M src/zope/server/ftp/server.py

  Log Message:
  -----------
  A better fix for #2

I looked at asyncore.py in Python 2.6 and 2.7:

- in 2.6 asyncore.dispatcher.handle_write_event() would call
  self.handle_connect_event() if self.connected was False.

- in 2.7 there's a new instance attribute self.connecting, and
  handle_write_event() calls handle_connect_event() only if
  self.connected is False and self.connecting is True

handle_connect_event() does a bit more than just set self.connected =
True: it also checks for pending socket errors.

See also: http://bugs.python.org/issue10340, which introduced the
`connecting` attribute in https://hg.python.org/cpython/rev/8c19c9914c22




More information about the checkins mailing list