Mailing List Archive

[issue1011] Wrong documentation for rfc822.Message.getheader
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@bugs.python.org>
<http://bugs.python.org/issue1011>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1011] Wrong documentation for rfc822.Message.getheader [ In reply to ]
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@bugs.python.org>
<http://bugs.python.org/issue1011>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue1011] Wrong documentation for rfc822.Message.getheader [ In reply to ]
Georg Brandl added the comment:

Thanks, fixed in rev. 57395.

----------
assignee: -> georg.brandl
nosy: +georg.brandl
resolution: -> fixed
status: open -> closed

__________________________________
Tracker <report@bugs.python.org>
<http://bugs.python.org/issue1011>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com