[New-bugs-announce] [issue8496] mailcap.lookup() returns filter iterator rather than list if key is given

Gregory Nofi report at bugs.python.org
Thu Apr 22 02:47:53 CEST 2010


New submission from Gregory Nofi <crackityjones2004-p at yahoo.com>:

The lookup method in the Python 3.2 mailcap module still uses filter as if it will return a list, like it did in Python 2. If a value for the "key" argument is passed to the method, the method will return a filter iterator rather than a list.

I discovered this while running a test I created for mailcap. It's not checked in yet. See Issue6484.

This is probably low priority because mailcap.lookup() is an internal method. It is used by mailcap.findmatch(), which actually handles the filter iterator gracefully. Nevertheless, I don't think it should return a different type based on whether the key argument is passed. The fix is simple enough.

----------
components: Library (Lib)
files: mailcap.v3.patch
keywords: patch
messages: 103931
nosy: gnofi
severity: normal
status: open
title: mailcap.lookup() returns filter iterator rather than list if key is given
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file17040/mailcap.v3.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8496>
_______________________________________


More information about the New-bugs-announce mailing list