Author terry.reedy
Recipients fviard, r.david.murray, terry.reedy
Date 2013-10-05.02:55:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1380941714.47.0.423608238279.issue19154@psf.upfronthosting.co.za>
In-reply-to
Content
Changing the API of HTTPResponse.fileno is a feature change, not a bug fix. I do not think it should be changed as it would break existing code to no purpose. Instead, calls should continue to wrapped in try: except ValueError when failure is possible. And this issue closed as rejected.

--
As to the illustrative example: 

I do not think the call in _fileobject.fileno should be so wrapped because I think the bug is elsewhere. _fileinput()._sock is supposed to be a socket, not an HTTPResponse. This says to me that a) self._sock.fileno() is supposed to call socket.fileno, not HTTPResonse.fileno; and b) nappstore/server_comm.py is calling socket(_sock=<HTTPResonse object>) (or directly modifying the .sock attribute).

If b) is true, that strikes me as a bug because _sock is an undocumented private parameter, subject to change. Indeed it disappeared in 3.x when socket became a _socket.socket subclass rather than a wrapper thereof. (Also, the pseudo _fileobject was replaced with an appropriate, real, io class.)
History
Date User Action Args
2013-10-05 02:55:14terry.reedysetrecipients: + terry.reedy, r.david.murray, fviard
2013-10-05 02:55:14terry.reedysetmessageid: <1380941714.47.0.423608238279.issue19154@psf.upfronthosting.co.za>
2013-10-05 02:55:14terry.reedylinkissue19154 messages
2013-10-05 02:55:14terry.reedycreate