Skip to content

gh-135698: Fix _interpqueues.create(): max_size >= 0 #135703

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 19, 2025

Make sure that the queue maximum size is greater than or equal to 0.

Make sure that the queue maximum size is greater than or equal to 0.
@vstinner
Copy link
Member Author

@ericsnowcurrently: Would you mind to review my change?

Comment on lines +1491 to +1495
if (maxsize < 0) {
PyErr_SetString(PyExc_ValueError,
"max_size must be greater than or equal to 0");
return NULL;
}
Copy link
Member

@ericsnowcurrently ericsnowcurrently Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A negative value is fine. That's the same as queue.Queue. The logic (and the assert) in _queue_is_full() is actually wrong. I'll put up a PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See gh-135724.

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

Successfully merging this pull request may close these issues.

2 participants