[issue13456] Providing a custom HTTPResponse class to HTTPConnection
New submission from R. David Murray <rdmurray@bitdance.com>: The doc string for HTTPConnection.getresponse mentions (in broken English) that the instance's response_class attribute determines what class gets instantiated for a response. The docs do not mention this attribute, nor any other way to control what class is used. Since this attribute already exists and is mentioned in the doc string, can we consider this a doc error and just document it? ---------- assignee: docs@python components: Documentation messages: 148136 nosy: docs@python, orsenthil, r.david.murray priority: normal severity: normal status: open title: Providing a custom HTTPResponse class to HTTPConnection versions: Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13456> _______________________________________
Mark Lawrence added the comment: ping. ---------- nosy: +BreamoreBoy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13456> _______________________________________
Angad Singh added the comment: I have a patch for this. I have also documented some of the non-documented attributes of HTTPConnection class. ---------- keywords: +patch nosy: +angad Added file: http://bugs.python.org/file39856/response_class.http.client.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13456> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- nosy: +berker.peksag stage: -> patch review type: -> enhancement versions: +Python 3.4, Python 3.5, Python 3.6 -Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13456> _______________________________________
Martin Panter added the comment: Why do people want “response_class” to be part of the API? If so, more details about it may need to added, e.g. the following methods and attributes seem to be required: _read_status(), fp, close(), isclosed(), begin() and will_close. The “debuglevel” attribute seems fairly redundant with the existing set_debuglevel() method. Also, what is the point of adding the “default_port” attribute, if it cannot be modified? The only use case I can imagine is in a subclass that specifically does modify it. But I’m not sure it should be added at all. So I am sorry, but I don’t see why any of the three additions in the patch should be made. IMO it would be better to explain that “response_class” is an internal implementation detail, or even drop it entirely from the doc string. ---------- nosy: +vadmium _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13456> _______________________________________
Change by Mark Lawrence <breamoreboy@gmail.com>: ---------- nosy: -BreamoreBoy _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13456> _______________________________________
participants (5)
-
Angad Singh
-
Berker Peksag
-
Mark Lawrence
-
Martin Panter
-
R. David Murray