Skip to content

_xxinterpqueues.get return strange value, when the queue is empty #116239

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

Closed
sobolevn opened this issue Mar 2, 2024 · 4 comments
Closed

_xxinterpqueues.get return strange value, when the queue is empty #116239

sobolevn opened this issue Mar 2, 2024 · 4 comments
Labels
pending The issue will be closed if no feedback is provided topic-subinterpreters type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Mar 2, 2024

Bug report

Code:

» ./python.exe                                      
Python 3.13.0a4+ (heads/main:5dc8c84d397, Mar  2 2024, 10:55:34) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _xxinterpqueues
>>> a = _xxinterpqueues.create(2, 9)
>>> _xxinterpqueues.get(a, 'a')
('a', 0)
>>> 

It is happening on a fresh build of main after #116102 is fixed.

I can reproduce this 100% of times, QueueEmpty as @ericsnowcurrently said in #116102 (comment) never happens to me.

I am on macos.

@Eclips4
Copy link
Member

Eclips4 commented Mar 2, 2024

Seems this behaviour is intentional. Second parameter on get method means default value. So, it's ok to not to see the QueueEmpty exception. But, why is there a tuple as a return value of get? The second item in this tuple looks superfluous (Should there really be a tuple here?)

@sobolevn
Copy link
Member Author

sobolevn commented Mar 2, 2024

(Should there really be a tuple here?)

Yes, the tuple is of (default, fmt).

@ericsnowcurrently
Copy link
Member

This should be cleared up by gh-116328.

@ericsnowcurrently ericsnowcurrently added the pending The issue will be closed if no feedback is provided label Jul 8, 2024
@Eclips4
Copy link
Member

Eclips4 commented Sep 14, 2024

This was fixed in #116328.

@Eclips4 Eclips4 closed this as completed Sep 14, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Subinterpreters Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending The issue will be closed if no feedback is provided topic-subinterpreters type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

3 participants