Skip to content

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I see! I closed my PR.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for taking time on this!

@vstinner vstinner closed this Jun 23, 2025
@AA-Turner AA-Turner removed needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Aug 14, 2025
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.

3 participants