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

The behavior of multithreading.Queue.empty() when the Queue is closed is not explained in the docs #120012

Closed
marcoslimagon opened this issue Jun 4, 2024 · 3 comments
Labels
docs Documentation in the Doc dir easy

Comments

@marcoslimagon
Copy link

marcoslimagon commented Jun 4, 2024

Documentation

https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Queue.empty

It should be added that in case of the given method Queue.empty() is called after Queue.close() it will raise `OSError("handle is closed")``
(A clear and concise description of the issue.)

Linked PRs

@marcoslimagon marcoslimagon added the docs Documentation in the Doc dir label Jun 4, 2024
@marcoslimagon marcoslimagon changed the title The behavior of multithreading.Queue.empty() is not well explained The behavior of multithreading.Queue.empty() when the Queue is closed is not explained in the docs Jun 4, 2024
@ericvsmith ericvsmith added the easy label Jun 4, 2024
@ericvsmith
Copy link
Member

That seems like a good change. I don't think we would typically include the error text in the docs, but the fact that it raises OSError in that case is worth noting.

gpshead added a commit that referenced this issue Jun 13, 2024
…closed queues. (GH-120102)

* improve doc for `multiprocessing.Queue.empty`
* add tests for checking emptiness of queues

Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 13, 2024
…y` on closed queues. (pythonGH-120102)

* improve doc for `multiprocessing.Queue.empty`
* add tests for checking emptiness of queues

(cherry picked from commit a3711af)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 13, 2024
…y` on closed queues. (pythonGH-120102)

* improve doc for `multiprocessing.Queue.empty`
* add tests for checking emptiness of queues

(cherry picked from commit a3711af)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
…y` on closed queues. (pythonGH-120102)

* improve doc for `multiprocessing.Queue.empty`
* add tests for checking emptiness of queues

Co-authored-by: Gregory P. Smith <greg@krypto.org>
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
…y` on closed queues. (pythonGH-120102)

* improve doc for `multiprocessing.Queue.empty`
* add tests for checking emptiness of queues

Co-authored-by: Gregory P. Smith <greg@krypto.org>
@rok
Copy link

rok commented Jul 14, 2024

This seems to have been resolved by #120102.

hugovk pushed a commit that referenced this issue Jul 14, 2024
…ty` on closed queues. (GH-120102) (#120469)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
hugovk pushed a commit that referenced this issue Jul 14, 2024
…ty` on closed queues. (GH-120102) (#120470)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
@hugovk
Copy link
Member

hugovk commented Jul 14, 2024

@rok Thanks for checking, I've merged the backports, let's close now.

@hugovk hugovk closed this as completed Jul 14, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
…y` on closed queues. (pythonGH-120102)

* improve doc for `multiprocessing.Queue.empty`
* add tests for checking emptiness of queues

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir easy
Projects
None yet
Development

No branches or pull requests

4 participants