-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
uname_result _asdict and _fields are missing platform #97966
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
Comments
I guess it's not as simple as you describe, because the code does attempt to emulate a 6-item tuple:
It's only in the All six attributes are present. I can tweak the docs to make this clearer, but is there an issue you encountered as a result? |
…e platform attribute and to indicate when it became late-bound.
@jaraco Thanks for converting my comment to an issue, You're right, To be more precise, my issue actually arises from the use of Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux
>>> import platform
>>> len(platform.uname()._fields)
5
>>> len(platform.uname()._asdict())
5 My code was expecting a length of |
The documentation said the return type is a I think the way to fix this is to either edit the documentation of |
I agree. Specifying the caveats is probably better. Another option might be to deprecate the (named)tuple behaviors altogether, which I proposed in #84758, but which was rejected. If we follow the guidance from @malemburg in that issue, it would suggest to fully emulate the |
…e platform attribute and to indicate when it became late-bound.
…nd ._asdict would include the processor.
…nd ._asdict would include the processor.
Re emulating |
The problem is a race condition / circular dependency on Linux/Mac:
Furthermore, this infinite loop is implemented in a subprocess loop, so it's not caught by the max recursion depth, so will consume resources on the user's machine until it runs out of some resource (memory, file descriptors, ...). All of this happens before You can reproduce this behavior by checking out cmdix and attempting to run the tests on Python 3.8 or earlier. Just run Other ways I've considered to address the issue include:
|
…form attribute and to indicate when it became late-bound. (#97972)
…sdict would include the processor. (gh-98343)
…nd ._asdict would include the processor. (pythongh-98343) (cherry picked from commit dc063a2) Co-authored-by: Jason R. Coombs <[email protected]>
…nd ._asdict would include the processor. (pythongh-98343) (cherry picked from commit dc063a2) Co-authored-by: Jason R. Coombs <[email protected]>
…sdict would include the processor. (gh-98343) (cherry picked from commit dc063a2) Co-authored-by: Jason R. Coombs <[email protected]>
…sdict would include the processor. (gh-98343) (cherry picked from commit dc063a2) Co-authored-by: Jason R. Coombs <[email protected]>
Not sure if this should be a new issue, but
platform.uname
docs for 3.12 still say:(my emphasis)
I've got python 3.10.6 installed, which returns 5 attributes, not including
processor
, as expected from the discussion above:Originally posted by @dennisvang in #84750 (comment)
Linked PRs
The text was updated successfully, but these errors were encountered: