I'm having trouble with things breaking based on x86 vs x64 in Python 3 on Windows.
I need to know if my Python program is running:
- On x64 vs. x86 Hardware
- On a x64 vs. x86 Operating System
- In a x64 vs. x86 Process
They are not the same thing (at all!).
AMD64 architecture processors can run either 64 or 32 bit operating systems.
And 64 bit operating systems can run either 64 or 32 bit processes.
I know that:
- Python's
platform.architecture()
returns a string - but which of those 3 does it represent? (The documentation doesn't seem to say.) - If
(sys.maxsize > 2**32)
then I'm in a 64 bit process. Fine; but if I'm in 32 bit process how can I tell if I'm on a 64 or 32 bit OS?
To forestall the inevitable "why do you care?" questions, it's because my Python program is automating configuration of Windows - things are in different places on x86 vs x64 Windows, but I don't know in advance if my program will be running on 32 or 64 bit Python.
So I need to figure that out.