[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-06 Thread Steve Dower


Steve Dower  added the comment:

> This includes _getdiskusage, _getfinalpathname, _getfullpathname, 
> _getvolumepathname, _isdir, and startfile. They have no place in a POSIX 
> module.

Except for startfile, I disagree. They are all there to help implement POSIX 
compatibility, and as private APIs, there's no better place to put them.

In any case, this issue is closed for now, pending a discussion on python-dev. 
If anyone feel strongly about making changes, it'll need to start with a post 
on the mailing list.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-06 Thread Eryk Sun


Eryk Sun  added the comment:

> Correct, though the examples I'd give are Win32 vs. WinRT vs. Cygwin, 
> which are fundamentally different API surfaces for interacting with 
> the operating system.

Cygwin and MSYS are presented as more than APIs; they're separate platforms. 
sys.platform is 'cygwin' or 'msys', and os.name is 'posix'.

The Windows platform name is "win32". If we could change it, I'd prefer 
"windows". The C API is the "Windows API" or WINAPI. It used to be called 
Win32, which is still the popular name. The ABI for 32-bit x86 (Intel 
Architecture) is "win32". If we could change it, I'd prefer "win-ia32" to 
parallel "win-amd64".

> os.name is also odd, and honestly I'd rather it just went away 
> completely. I'd like the module to be called "posix" everywhere, 
> since that's the API it exposes (it's an emulation layer on 
> non-POSIX platforms), and checks should use sys.platform. 

os is too entrenched to be renamed. But I'd like it if nt (posixmodule.c) were 
renamed windows_posix (or win32_posix) -- since it has nothing to do with the 
NT API. We would need to move the Windows-only functions to a "windows" (or 
"win32") platform module. This includes _getdiskusage, _getfinalpathname, 
_getfullpathname, _getvolumepathname, _isdir, and startfile. They have no place 
in a POSIX module.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread Steve Dower


Steve Dower  added the comment:

> sys.platform is defined by code path taken while compiling. it is hardcoded 
> and really represents the os abi used of a *supported* platform

Correct, though the examples I'd give are Win32 vs. WinRT vs. Cygwin, which are 
fundamentally different API surfaces for interacting with the operating system.

sys.platform is win32 whenever Python is built against the Win32 API. 
sysconfig.get_platform is win32 when packages need to be built for 32-bit 
Windows. It's unfortunate that they were chosen to be the same, but that's long 
in the past, and I don't think the confusion is worth the confusion that would 
occur if it changed.

os.name is also odd, and honestly I'd rather it just went away completely. I'd 
like the module to be called "posix" everywhere, since that's the API it 
exposes (it's an emulation layer on non-POSIX platforms), and checks should use 
sys.platform. Or at worst, "_os" instead of having an importable "nt" module. 
But for better or worse, that's how Python is designed, and until there's a 
serious project to redesign aspects at this level we aren't going to see any 
change.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread pmpp


pmpp  added the comment:

> what is the difference

sys.platform is defined by code path taken while compiling. it is hardcoded and 
really represents the os abi used of a *supported* platform, it is to be 
trusted.

while sysconfig.get_platform() try to guess from various sources with more or 
less success.

> changing sys.platform
on windows there are a number of different abi ( eg  msvc (32/64 supported) / 
cygwin / mingw / midipix   ) and one should expect sys.platform to point to 
the correct one.

The maintainers ( like steve.dower ) help choose carrefully those codes and 
ensure they will always work, so i think you have been answered.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread jcrmatos


jcrmatos  added the comment:

Then what is the difference between sysconfig.get_platform and sys.platform? 
When should we use one or the other?

Maybe changing sys.platform to 'win' instead of 'win32', like was done with 
'linux' in Python 3.3 (changed from 'linux2' and 'linux3') would be a step in 
standardization and simplification.

Another one is sys.platform and sysconfig.platform return 'win32' and os.name 
returns 'nt'. Can't it be changed (in Python 4) to 'win', maybe with a 
deprecation warning starting in 3.8?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread Steve Dower


Steve Dower  added the comment:

This is intentional. The "platform" here represents the Python platform (for 
figuring out whether native modules are compatible), and since it's the 32-bit 
build of Python it should specify the 32-bit platform.

To find out information about the machine you are running on, look at the 
platform module: https://docs.python.org/3/library/platform.html

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-05 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-04 Thread pmpp


pmpp  added the comment:

from what I remember it's a platform-vm where you can't call (host) 64bits abi 
or access (host) 64 bits registry. registry calls are overlaid under a "WoW64" 
branch in host registry. Nothing like aarch64 or Darwin

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-04 Thread jcrmatos


jcrmatos  added the comment:

That's the name of the subsystem, not the platform.
Check the article you indicated
"In computing on Microsoft platforms, SysWoW64 (Windows 32-bit on Windows 
64-bit) is a subsystem..."

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-04 Thread pmpp


pmpp  added the comment:

i think that platform is called SysWoW64 and is more or less win32.
https://en.wikipedia.org/wiki/WoW64

--
nosy: +pmpp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35896] sysconfig.get_platform returns wrong value when Python 32b is running under Windows 64b

2019-02-04 Thread jcrmatos


New submission from jcrmatos :

sysconfig.get_platform returns wrong value when Python 32b is running under 
Windows 64b.
It should return win-amd64 and returns win32.

--
messages: 334841
nosy: jcrmatos
priority: normal
severity: normal
status: open
title: sysconfig.get_platform returns wrong value when Python 32b is running 
under Windows 64b
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com