classification
Title: concurrent.futures.as_completed() no longer accepts arbitrary iterables
Type: behavior Stage: resolved
Components: Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: lukasz.langa Nosy List: grzgrzgrz3, lukasz.langa, ned.deily, pitrou, vstinner
Priority: Keywords: 3.6regression, patch

Created on 2017-09-29 19:49 by lukasz.langa, last changed 2017-10-03 08:51 by ned.deily. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3830 merged lukasz.langa, 2017-09-29 21:18
PR 3831 merged python-dev, 2017-09-29 21:33
Messages (7)
msg303355 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2017-09-29 19:49
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.
msg303357 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-09-29 20:59
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.
msg303359 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2017-09-29 21:33
New changeset 574562c5ddb2f0429aab9af762442e6f9a3f26ab by Łukasz Langa in branch 'master':
bpo-31641: Allow arbitrary iterables in `concurrent.futures.as_completed()` (#3830)
https://github.com/python/cpython/commit/574562c5ddb2f0429aab9af762442e6f9a3f26ab
msg303361 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2017-09-29 22:07
New changeset 9ef28b6ad3d5aff767e3d852499def8b5ae5ff5d by Łukasz Langa (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31641: Allow arbitrary iterables in `concurrent.futures.as_completed()` (GH-3830) (#3831)
https://github.com/python/cpython/commit/9ef28b6ad3d5aff767e3d852499def8b5ae5ff5d
msg303364 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2017-09-29 22:25
Fix is already landed in 3.6 and master.
msg303583 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-10-03 08:48
New changeset 2e3fd03796528a9f88f79d38e1d890af153c8e61 by Ned Deily (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31641: Allow arbitrary iterables in `concurrent.futures.as_completed()` (GH-3830) (#3831)
https://github.com/python/cpython/commit/2e3fd03796528a9f88f79d38e1d890af153c8e61
msg303584 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-10-03 08:51
Cherry picked into 3.6.3 final -> closing
History
Date User Action Args
2017-10-03 08:51:45ned.deilysetpriority: release blocker ->
2017-10-03 08:51:35ned.deilysetstatus: open -> closed
resolution: fixed
messages: + msg303584

stage: patch review -> resolved
2017-10-03 08:48:30ned.deilysetmessages: + msg303583
2017-09-29 22:25:14lukasz.langasetmessages: + msg303364
2017-09-29 22:07:04lukasz.langasetmessages: + msg303361
2017-09-29 21:33:45python-devsetpull_requests: + pull_request3814
2017-09-29 21:33:36lukasz.langasetmessages: + msg303359
2017-09-29 21:18:13lukasz.langasetkeywords: + patch
pull_requests: + pull_request3813
2017-09-29 20:59:34ned.deilysetmessages: + msg303357
2017-09-29 20:24:34lukasz.langasetnosy: + vstinner
2017-09-29 19:49:30lukasz.langacreate