[issue3826] BaseHTTPRequestHandler depends on GC to close connections

Gregory P. Smith report at bugs.python.org
Tue Jan 6 00:29:47 CET 2009


Gregory P. Smith <greg at krypto.org> added the comment:

from #python-dev discussion.

agreed, magic attributes are annoying.  also, my gps05 patch continues
to return the old fileno even after the underlying socket has been
closed.  that is a problem.

I like your patch in #4791 but lets keep both sets of our unit tests.

Also, I think the SocketIO.fileno mathod should change to:

  def fileno(self):
    no = self._sock.fileno()
    if no == -1:
      raise IOError("no file descriptor, socket is closed.")

io.IOBase.fileno already raises IOError when no file descriptor is
associated with a file so this behavior seems reasonable and more
pythonic than returning a magic -1.

thoughts?

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3826>
_______________________________________


More information about the Python-bugs-list mailing list