Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mailcap.lookup() returns filter iterator rather than list if key is given #52742

Closed
gnofi mannequin opened this issue Apr 22, 2010 · 4 comments
Closed

mailcap.lookup() returns filter iterator rather than list if key is given #52742

gnofi mannequin opened this issue Apr 22, 2010 · 4 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@gnofi
Copy link
Mannequin

gnofi mannequin commented Apr 22, 2010

BPO 8496
Nosy @pitrou
Files
  • mailcap.v3.patch: Patch to Lib/mailcap.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-04-22.13:30:30.650>
    created_at = <Date 2010-04-22.00:47:51.754>
    labels = ['type-bug', 'library']
    title = 'mailcap.lookup() returns filter iterator rather than list if key is given'
    updated_at = <Date 2010-04-22.13:30:30.649>
    user = 'https://bugs.python.org/gnofi'

    bugs.python.org fields:

    activity = <Date 2010-04-22.13:30:30.649>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-04-22.13:30:30.650>
    closer = 'pitrou'
    components = ['Library (Lib)']
    creation = <Date 2010-04-22.00:47:51.754>
    creator = 'gnofi'
    dependencies = []
    files = ['17040']
    hgrepos = []
    issue_num = 8496
    keywords = ['patch']
    message_count = 4.0
    messages = ['103931', '103959', '103960', '103967']
    nosy_count = 2.0
    nosy_names = ['pitrou', 'gnofi']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue8496'
    versions = ['Python 3.1', 'Python 3.2']

    @gnofi
    Copy link
    Mannequin Author

    gnofi mannequin commented Apr 22, 2010

    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 bpo-6484.

    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.

    @gnofi gnofi mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 22, 2010
    @pitrou
    Copy link
    Member

    pitrou commented Apr 22, 2010

    Looks goot to me.

    @pitrou
    Copy link
    Member

    pitrou commented Apr 22, 2010

    Good, sorry.

    @pitrou
    Copy link
    Member

    pitrou commented Apr 22, 2010

    Committed in r80369. Thanks!

    @pitrou pitrou closed this as completed Apr 22, 2010
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant