[New-bugs-announce] [issue1011] Wrong documentation for rfc822.Message.getheader

Nir Soffer report at bugs.python.org
Fri Aug 24 15:33:45 CEST 2007


New submission from Nir Soffer:

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.

----------
components: Documentation
messages: 55254
nosy: nirs
severity: normal
status: open
title: Wrong documentation for rfc822.Message.getheader
versions: Python 2.5

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1011>
__________________________________


More information about the New-bugs-announce mailing list