You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong documentation for rfc822.Message.getheader #45352
"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.
Activity
nirs commentedon Aug 24, 2007
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.
birkenfeld commentedon Aug 24, 2007
Thanks, fixed in rev. 57395.