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: Wrong documentation for rfc822.Message.getheader
Type: Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, nirs
Priority: normal Keywords:

Created on 2007-08-24 13:33 by nirs, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg55254 - (view) Author: Nir Soffer (nirs) * Date: 2007-08-24 13:33
In http://docs.python.org/lib/message-objects.html, getheader doc say:

 "Like getrawheader(name), but strip leading and trailing whitespace. 
Internal whitespace is not stripped. The optional default argument can 
be used to specify a different default to be returned when there is no 
header matching name."

However, getheader is not like getrawheader. getheader return the *last* 
header seen, using the message dict. getrawheader retruns the *first* 
header line seen, searching through the list of parsed header lines.

The text should also note that getheader is faster and the preferred way 
to get parsed headers.
msg55261 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-08-24 17:23
Thanks, fixed in rev. 57395.
History
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45352
2007-08-24 17:23:42georg.brandlsetstatus: open -> closed
assignee: georg.brandl
resolution: fixed
messages: + msg55261
nosy: + georg.brandl
2007-08-24 13:33:45nirscreate