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

ThreadPoolExecutor should fail when max_worker is 0 #55

Closed
leplatrem opened this issue May 31, 2016 · 6 comments
Closed

ThreadPoolExecutor should fail when max_worker is 0 #55

leplatrem opened this issue May 31, 2016 · 6 comments
Labels

Comments

@leplatrem
Copy link

I noticed a difference when instantiated the executor with ThreadPoolExecutor(max_workers=0).
The backport does not raise, whereas the 3.5 raises a ValueError:

  File "/opt/python/3.5.0/lib/python3.5/concurrent/futures/thread.py", line 96, in __init__
    raise ValueError("max_workers must be greater than 0")

ValueError: max_workers must be greater than 0
@agronholm
Copy link
Owner

The backport is a backport of Python 3.2's ThreadPoolExecutor. That said, I guess this is trivial enough to incorporate in the backport.

@leplatrem
Copy link
Author

You're right, there is no error in python 3.2.

I just wanted to let you know because I came into it, but I don't think it is crucial ;)

@cutewalker
Copy link

well, why does this backport keep API of py32 which is too old for production use.
Both max_workers is 0 and None ( #54 ) will silently lead to an executor with no worker, that is really too bad

@agronholm
Copy link
Owner

The changes made in the newer versions of concurrent.futures require Python core changes to work. That's why I haven't backported any newer versions. For reliable process pools, you must upgrade to Python 3.x. As for this particular change, I'll make it happen this week when I have the time.

@agronholm agronholm added the bug label Nov 8, 2016
@agronholm
Copy link
Owner

Fixed in 0913853.

@cutewalker
Copy link

Aha, thanks very much for such a quick response, and sorry for the late regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants