[issue19154] AttributeError: 'NoneType' in http/client.py when using select when file descriptor is closed.

Florent Viard report at bugs.python.org
Mon Oct 7 11:56:55 CEST 2013


Florent Viard added the comment:

Hi Terry,
I think you misunderstood what i was trying to say.
Maybe fileno should raise a ValueError (and not -1) in that case. That is the question. It should only be able to be something understood by "select.select".
But currently it is an Bug/Crash as the case where self.fp is None is not handled before trying to get self.fp.fileno() and so this raise an AttributeError and not a ValueError. And so, it is certainly not managed by select.

Please really understand that here I speak about the "def fileno()" function that is inside Lib/http/client.py" and not about the "def fileno()" that is in socket.py.

----------

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


More information about the Python-bugs-list mailing list