This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients jaraco, lemburg, pitrou
Date 2019-03-08.16:45:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1552063511.38.0.912760507061.issue35967@roundup.psfhosted.org>
In-reply-to
Content
> the output of platform.uname() needs to stay compatible to what the function returned prior

Do we really wish to retain the output for this unreliable interface, especially when it is not standardized and is returning improper information? Is it valuable for `platform.processor()` to return "i386" (a 34-year-old processor) for my 2017 Macbook Pro?

Does maintaining compatibility for `platform.uname()` also imply that `platform.processor()` needs to return `platform.uname().processor`, or could the interface on the latter change, to provide a more useful value, while retaining the behavior of `platform.uname()`?

My instinct is it's impractical to attempt to maintain all of these forks of "uname -p", especially when the result is a largely unpredictable value, so I'm considering the only other viable option I can conceive now:

 - retain the subprocess call to "uname", but bind it late, as a functools.cached_property, such that "uname -p" is only ever called when the processor property is requested. This approach would also require overriding __iter__ and __getitem__ to retain the namedtuple interface while having that element resolved late.

I was also considering this: instead of invoking "uname" anywhere on the path, invoke it from an explicit whitelist of paths, such as /bin and /usr/bin, so that it's never self-referential. Unfortunately, that wouldn't work if a Python-based implementation were put on one of those paths, so it would be brittle at best.

Marc-Andre, I'd love your feedback in light of these challenges.
History
Date User Action Args
2019-03-08 16:45:11jaracosetrecipients: + jaraco, lemburg, pitrou
2019-03-08 16:45:11jaracosetmessageid: <1552063511.38.0.912760507061.issue35967@roundup.psfhosted.org>
2019-03-08 16:45:11jaracolinkissue35967 messages
2019-03-08 16:45:10jaracocreate