This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: The documentation for http.server error_message_format is inadequate.
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Anastasia.Filatova, berker.peksag, docs@python, eric.araujo, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2014-01-02 22:32 by r.david.murray, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Issue20112_py34.patch Anastasia.Filatova, 2014-03-18 08:24 review
Issue20112_py33.patch Anastasia.Filatova, 2014-03-18 08:29 review
Issue20112_py27.patch Anastasia.Filatova, 2014-03-18 08:34 review
Messages (10)
msg207194 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-01-02 22:32
The description of error_message_format does not give enough information to use it.  The description should talk about how it is used (ie: using % formatting) and the fact that when filled in it should form a complete html document because it will be sent as the error response body.  It should not talk about what "the code key should be", etc, but should instead say what they *will* be, and cross reference the send_error method as the thing that uses it.
msg213366 - (view) Author: (Anastasia.Filatova) * Date: 2014-03-13 09:11
I made a patch on this issue. I added a small example to the description. Should I provide a more detailed example or that one will be enough? Could someone please review the patch?
msg213768 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-03-16 22:43
My intent here was that the rewrite should specify where the data that gets placed into the template when it is used comes from.  That would be 'responses' by default, but can be overridden in 'send_error'.
msg213770 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-03-16 22:48
Hmm.  Rereading your patch I see that that is what you are trying to do, but I find the order of presentation confusing.  I would rather see the text focus on the fact that the string is used by send_error, and that the variables are filled by default from responses based on the code passed to send_error, and that you can also specify an alternate explain message that overrides the one from responses when calling send_error.
msg213872 - (view) Author: (Anastasia.Filatova) * Date: 2014-03-17 14:32
Thank you, David, for review! I understood your point of view, an updated patch will be added soon.
msg213884 - (view) Author: (Anastasia.Filatova) * Date: 2014-03-17 19:19
So new patch is updated. Could someone please give me feedback on it?
msg213885 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-03-17 19:29
Thanks, the doc is much clearer now.  Could you also address my comments?  (If you did not get email, the comments can be accessed with the “review” link in the list of files attached to this report.)
msg213948 - (view) Author: (Anastasia.Filatova) * Date: 2014-03-18 08:29
Thank you, Eric for your comments! I see now what doese the 'review' link mean :)   You are right the send_error should be a method not a class variable. I changed it in a new patch. As regards the responses I prefer don't change it to a class attribute because in documentation it is mentioned as a class variable in several places. I also checked that :attr:`send_error` does generate a link to send_error method in html.
msg264073 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-23 22:51
New changeset a912ca4f507b by Berker Peksag in branch '3.5':
Issue #20112: Improve BaseHTTPRequestHandler.error_message_format documentation
https://hg.python.org/cpython/rev/a912ca4f507b

New changeset baed33df1aed by Berker Peksag in branch 'default':
Issue #20112: Improve BaseHTTPRequestHandler.error_message_format documentation
https://hg.python.org/cpython/rev/baed33df1aed
msg264074 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-04-23 22:52
Thanks for the patch, Anastasia.
History
Date User Action Args
2022-04-11 14:57:56adminsetgithub: 64311
2016-04-23 22:52:23berker.peksagsetstatus: open -> closed

versions: + Python 3.5, Python 3.6, - Python 3.3, Python 3.4
nosy: + berker.peksag

messages: + msg264074
resolution: fixed
stage: needs patch -> resolved
2016-04-23 22:51:22python-devsetnosy: + python-dev
messages: + msg264073
2014-03-18 08:34:08Anastasia.Filatovasetfiles: + Issue20112_py27.patch
2014-03-18 08:29:24Anastasia.Filatovasetmessages: + msg213948
2014-03-18 08:29:09Anastasia.Filatovasetfiles: + Issue20112_py33.patch
2014-03-18 08:24:30Anastasia.Filatovasetfiles: + Issue20112_py34.patch
2014-03-18 08:24:09Anastasia.Filatovasetfiles: - Issue20112_py27.patch
2014-03-18 08:24:02Anastasia.Filatovasetfiles: - Issue20112_py33.patch
2014-03-18 08:23:55Anastasia.Filatovasetfiles: - Issue20112_py34.patch
2014-03-17 19:29:51eric.araujosetnosy: + eric.araujo
messages: + msg213885
2014-03-17 19:19:24Anastasia.Filatovasetmessages: + msg213884
2014-03-17 19:16:56Anastasia.Filatovasetfiles: + Issue20112_py34.patch
2014-03-17 19:16:45Anastasia.Filatovasetfiles: + Issue20112_py33.patch
2014-03-17 19:16:28Anastasia.Filatovasetfiles: + Issue20112_py27.patch
2014-03-17 19:16:00Anastasia.Filatovasetfiles: - Issue20112_py33.patch
2014-03-17 19:15:54Anastasia.Filatovasetfiles: - Issue20112_py34.patch
2014-03-17 19:15:45Anastasia.Filatovasetfiles: - Issue20112_py27.patch
2014-03-17 14:32:09Anastasia.Filatovasetmessages: + msg213872
2014-03-16 22:48:45r.david.murraysetmessages: + msg213770
2014-03-16 22:43:34r.david.murraysetmessages: + msg213768
2014-03-13 09:12:15Anastasia.Filatovasetfiles: + Issue20112_py34.patch
2014-03-13 09:12:03Anastasia.Filatovasetfiles: + Issue20112_py33.patch
2014-03-13 09:11:51Anastasia.Filatovasetfiles: + Issue20112_py27.patch

nosy: + Anastasia.Filatova
messages: + msg213366

keywords: + patch
2014-01-02 22:32:32r.david.murraycreate