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: mailcap.lookup() returns filter iterator rather than list if key is given
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gnofi, pitrou
Priority: normal Keywords: patch

Created on 2010-04-22 00:47 by gnofi, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mailcap.v3.patch gnofi, 2010-04-22 00:47 Patch to Lib/mailcap.py
Messages (4)
msg103931 - (view) Author: Gregory Nofi (gnofi) Date: 2010-04-22 00:47
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.
msg103959 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-04-22 12:30
Looks goot to me.
msg103960 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-04-22 12:31
Good, sorry.
msg103967 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-04-22 13:30
Committed in r80369. Thanks!
History
Date User Action Args
2022-04-11 14:57:00adminsetgithub: 52742
2010-04-22 13:30:30pitrousetstatus: open -> closed
resolution: fixed
messages: + msg103967

stage: patch review -> resolved
2010-04-22 12:31:01pitrousetmessages: + msg103960
2010-04-22 12:30:31pitrousetpriority: normal
versions: + Python 3.1
nosy: + pitrou

messages: + msg103959

stage: patch review
2010-04-22 00:47:51gnoficreate