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

concurrent.futures.as_completed() no longer accepts arbitrary iterables #75822

Closed
ambv opened this issue Sep 29, 2017 · 7 comments
Closed

concurrent.futures.as_completed() no longer accepts arbitrary iterables #75822

ambv opened this issue Sep 29, 2017 · 7 comments
Assignees
Labels
3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error

Comments

@ambv
Copy link
Contributor

ambv commented Sep 29, 2017

BPO 31641
Nosy @pitrou, @vstinner, @ned-deily, @ambv, @grzgrzgrz3
PRs
  • bpo-31641: Allow arbitrary iterables in concurrent.futures.as_completed() #3830
  • [3.6] bpo-31641: Allow arbitrary iterables in concurrent.futures.as_completed() (GH-3830) #3831
  • 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 = 'https://github.com/ambv'
    closed_at = <Date 2017-10-03.08:51:35.285>
    created_at = <Date 2017-09-29.19:49:30.607>
    labels = ['type-bug', '3.7']
    title = 'concurrent.futures.as_completed() no longer accepts arbitrary iterables'
    updated_at = <Date 2017-10-03.08:51:45.011>
    user = 'https://github.com/ambv'

    bugs.python.org fields:

    activity = <Date 2017-10-03.08:51:45.011>
    actor = 'ned.deily'
    assignee = 'lukasz.langa'
    closed = True
    closed_date = <Date 2017-10-03.08:51:35.285>
    closer = 'ned.deily'
    components = []
    creation = <Date 2017-09-29.19:49:30.607>
    creator = 'lukasz.langa'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31641
    keywords = ['patch', '3.6regression']
    message_count = 7.0
    messages = ['303355', '303357', '303359', '303361', '303364', '303583', '303584']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'vstinner', 'ned.deily', 'lukasz.langa', 'grzgrzgrz3']
    pr_nums = ['3830', '3831']
    priority = None
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31641'
    versions = ['Python 3.6', 'Python 3.7']

    @ambv
    Copy link
    Contributor Author

    ambv commented Sep 29, 2017

    bpo-27144 introduced a regression for as_completed(): it used to accept arbitrary iterables but now requires sequences, otherwise raising an exception like:

    Traceback (most recent call last):
      File "sandcastle/worker/sandcastle_worker.py", line 1266, in get_work_item
      File "jupiter/jupiter_client.py", line 166, in acquireWork
      File "jupiter/jupiter_client.py", line 241, in _acquire_multiple_async
      File "jupiter/jupiter_client.py", line 336, in _wait_for_responses
      File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python3.6/concurrent/futures/_base.py", line 217, in as_completed
        total_futures = len(fs)
    TypeError: object of type 'map' has no len()

    Since as_completed() is a very popular function, we need to revert the behavior here.

    @ambv ambv self-assigned this Sep 29, 2017
    @ambv ambv added the type-bug An unexpected behavior, bug, or error label Sep 29, 2017
    @ned-deily
    Copy link
    Member

    Sounds like we need to get this fixed for 3.6.3 final which is scheduled for Monday (3 days). Or revert the previous fix.

    @ambv
    Copy link
    Contributor Author

    ambv commented Sep 29, 2017

    New changeset 574562c by Łukasz Langa in branch 'master':
    bpo-31641: Allow arbitrary iterables in concurrent.futures.as_completed() (bpo-3830)
    574562c

    @ambv
    Copy link
    Contributor Author

    ambv commented Sep 29, 2017

    New changeset 9ef28b6 by Łukasz Langa (Miss Islington (bot)) in branch '3.6':
    [3.6] bpo-31641: Allow arbitrary iterables in concurrent.futures.as_completed() (GH-3830) (bpo-3831)
    9ef28b6

    @ambv
    Copy link
    Contributor Author

    ambv commented Sep 29, 2017

    Fix is already landed in 3.6 and master.

    @ned-deily
    Copy link
    Member

    New changeset 2e3fd03 by Ned Deily (Miss Islington (bot)) in branch '3.6':
    [3.6] bpo-31641: Allow arbitrary iterables in concurrent.futures.as_completed() (GH-3830) (bpo-3831)
    2e3fd03

    @ned-deily
    Copy link
    Member

    Cherry picked into 3.6.3 final -> closing

    @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
    3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants