Skip to content

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

Closed
vstinner wants to merge 1 commit intopython:mainfrom
vstinner:queues_create
Closed

gh-135698: Fix _interpqueues.create(): max_size >= 0#135703
vstinner wants to merge 1 commit intopython:mainfrom
vstinner:queues_create

Conversation

@vstinner
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@vstinner vstinner deleted the queues_create branch December 3, 2025 15:36
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