[New-bugs-announce] [issue7860] 32-bit Python on 64-bit Windows reports incorrect architecture

Brian Curtin report at bugs.python.org
Fri Feb 5 19:07:50 CET 2010


New submission from Brian Curtin <curtin at acm.org>:

When running 32-bit Python on a 64-bit version of Windows, therefore running the process in WOW64 mode, platform.machine returns a misleading value. When running in WOW64, the processor architecture is masked to appear as "x86" when the machine is actually "AMD64" (which you see on a 64-bit app on 64-bit OS).

The change involves looking at an environment variable only set on WOW64 processes to see the native architecture. See http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx

The patch does not include any test, as I'm not really sure how you could test this without using the change itself to figure out when it should be tested. Suggestions would be appreciated.

----------
components: Library (Lib), Windows
files: arch_misrepresented.diff
keywords: needs review, patch, patch
messages: 98890
nosy: brian.curtin
priority: normal
severity: normal
stage: patch review
status: open
title: 32-bit Python on 64-bit Windows reports incorrect architecture
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file16143/arch_misrepresented.diff

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


More information about the New-bugs-announce mailing list