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 ned.deily
Recipients ned.deily, ronaldoussoren
Date 2010-12-19.06:28:26
SpamBayes Score 1.5581996e-09
Marked as misclassified No
Message-id <1292740109.65.0.867895032728.issue10735@psf.upfronthosting.co.za>
In-reply-to
Content
OS X Mach-O universal executable files often contain multiple architectures including a combination of 32-bit and 64-bit archs, as with the newer OS X installer variants provided on python.org.  In such cases, the platform.architecture() function always returns '64bit' as the bit architecture regardless of whether the interpreter is running in 32-bit or 64-bit mode.  Thus, there is no documented way to reliably tell whether an interpreter is running in 32- or 64-bit in OS X.  Instead of the platform module, one must resort to hacks like examining sys.maxsize (or sys.maxint) or checking type sizes from the struct module.

$ arch -x86_64 /usr/local/bin/python3.2 -c 'import sys,platform; 
print(sys.maxsize,platform.architecture())'
9223372036854775807 ('64bit', '')
$ arch -i386 /usr/local/bin/python3.2 -c 'import sys,platform; 
print(sys.maxsize,platform.architecture())'
2147483647 ('64bit', '')
History
Date User Action Args
2010-12-19 06:28:29ned.deilysetrecipients: + ned.deily, ronaldoussoren
2010-12-19 06:28:29ned.deilysetmessageid: <1292740109.65.0.867895032728.issue10735@psf.upfronthosting.co.za>
2010-12-19 06:28:26ned.deilylinkissue10735 messages
2010-12-19 06:28:26ned.deilycreate