[issue10735] platform.architecture() gives misleading results for OS X multi-architecture executables

Marc-Andre Lemburg report at bugs.python.org
Mon Feb 20 14:17:13 EST 2017


Marc-Andre Lemburg added the comment:

I think there's a misunderstanding in what platform.architecture() is meant for. The purpose is to find out more details about the executable you pass to it, e.g. whether it's a 32-bit or 64-bit binary, or whether it's an ELF or PE binary. And it's a best effort API, just as most other platform APIs - this is also the reason why most of them have parameters available to modify the default return values.

It doesn't work with multi-architecture executables. We'd need a new API for this.

Regarding returning multiple architectures in the linkage return value: I'm not sure whether that's a good idea. The architectures are not necessarily of different linkage types. In fact on Macs, the correct values is "Mach-O". The API should probably return this instead of the default empty string.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10735>
_______________________________________


More information about the Python-bugs-list mailing list