[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: This one is still not merged in Tulip, right? -- nosy: +yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20367 ___

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-02-05 Thread Guido van Rossum
Guido van Rossum added the comment: Correct, if you want to work on it, see http://code.google.com/p/tulip/issues/detail?id=114 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20367 ___

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 791b69f9f96d by Victor Stinner in branch '3.3': Issue #20367: Fix behavior of concurrent.futures.as_completed() for duplicate http://hg.python.org/cpython/rev/791b69f9f96d -- ___ Python tracker

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-27 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- resolution: remind - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20367 ___

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-26 Thread Glenn Langford
Glenn Langford added the comment: Ah...ok, here is a patch that includes an update to Doc/library/concurrent.futures.rst as well. -- Added file: http://bugs.python.org/file33728/issue20367.patch ___ Python tracker rep...@bugs.python.org

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset 58b0f3e1ddf8 by Guido van Rossum in branch 'default': Fix issue #20367: concurrent.futures.as_completed() for duplicate arguments. http://hg.python.org/cpython/rev/58b0f3e1ddf8 -- nosy: +python-dev ___

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-26 Thread Guido van Rossum
Changes by Guido van Rossum gu...@python.org: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20367 ___

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1dac8c954488 by Victor Stinner in branch 'default': Issue #20367: Add Glenn Langford to Misc/ACKS http://hg.python.org/cpython/rev/1dac8c954488 -- ___ Python tracker rep...@bugs.python.org

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-26 Thread STINNER Victor
STINNER Victor added the comment: @Guido: Why not fixing the issue in Python 3.3? You forgot to add Gleen Langford to Misc/ACKS! @Gleen: Congrats for your first commit :) -- ___ Python tracker rep...@bugs.python.org

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-26 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, I suppose it needs to be backported to 3.3. If someone wants to do that, please do (I'm afraid I'd mess up the merge). -- resolution: fixed - remind status: closed - open ___ Python tracker

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-26 Thread Glenn Langford
Glenn Langford added the comment: @Victor: Thank you, and I appreciate all your advice! I am still learning the dev environment but hope to be helpful. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20367

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-25 Thread Guido van Rossum
Guido van Rossum added the comment: LGTM. But you also need to update Doc/library/concurrent.futures.rst I see this as a bugfix so it's not necessary to get this in before the beta 3 release tonight. I will work on an asyncio patch and test. --

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-24 Thread Glenn Langford
Glenn Langford added the comment: Proposed patch for as_completed(). #20369 fixes wait(), and behaviour is consistent between the two. -- keywords: +patch Added file: http://bugs.python.org/file33684/issue20367.patch ___ Python tracker

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-24 Thread STINNER Victor
STINNER Victor added the comment: Proposed patch for as_completed(). Could you please try to write a unit test. The unit test should fail without the patch, and fail with the patch. Then create a new patch including the patch. If it's tricky to write a reliable test reproducing the race

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-24 Thread Glenn Langford
Glenn Langford added the comment: Could you please try to write a unit test. Revised patch with unit test for as_completed(). -- Added file: http://bugs.python.org/file33685/issue20367.patch ___ Python tracker rep...@bugs.python.org

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-24 Thread STINNER Victor
STINNER Victor added the comment: Hum, you should also modify the documentation to explicit the behaviour. Example: Duplicates futures are only yielded once. You may add the same sentence in the asyncio.as_completed() documentation. It looks like asyncio tests doesn't test as_completed() with

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-24 Thread Glenn Langford
Glenn Langford added the comment: Thanks for the feedback. The new patch is modified for PEP8 with naming consistent with other concurrent tests. assertEqual I think is clearer by checking list length, so it is not changed. The docstring is updated. I suggest asyncio be handled separately.

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-23 Thread Glenn Langford
Changes by Glenn Langford glenn.langf...@gmail.com: -- nosy: +haypo, mark.dickinson, tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20367 ___

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-23 Thread Glenn Langford
New submission from Glenn Langford: concurrent.futures.as_completed([f,f]) will yield f twice, then fail with a KeyError for a Future f which is not completed. If the Future has already completed, as_completed([f,f]) will yield f once and does not trigger an exception. What is the correct

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-23 Thread Glenn Langford
Glenn Langford added the comment: There is a subtlety in the as_completed() code which explains a lot - note that finished starts off as a set in the _AcquireFutures block. So if a Future f has already completed, as_completed( [f,f] ) will only yield f once, because f appears once in the

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-23 Thread STINNER Victor
STINNER Victor added the comment: Since the new asyncio module has also a Future class and functions like as_completed(), this issue concerns also asyncio. concurrent.futures and asyncio should have the same behaviour. -- nosy: +gvanrossum ___

[issue20367] concurrent.futures.as_completed() fails when given duplicate Futures

2014-01-23 Thread Guido van Rossum
Guido van Rossum added the comment: I think you the caller was wrong to pass in [f, f] in the first place. In asyncio, the argument is converted into a set before using it, but there's still a bug if you pass it a list containing two references to the same coroutine -- it gets wrapped in two