[issue12795] Remove the major version from sys.platform

2011-10-13 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: While working on #12326, it's realized that many modules and applications rely on sys.platform. Change this value should be decided for each platform because it breaks backward compatibility. Linux was a special case and now I

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Having the major version in sys.platform only for a few selected platforms doesn't seem too consistent for me. If linux 4 will introduce major changes, will we have to look for the major version of freebsd in sys.platform and for the

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Moved the discussion here from issue12326: [Larry Hastings] If we're changing linux2 / linux3 to just linux, we should be consistent and do it for everybody. I propose sys.platform under 3.3 should contain things like linux, freebsd,

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: FreeBSD or OpenBSD release major version frequently, something like one per year, or one per two years. FreeBSD and OpenBSD developers knows that for years, and Python programs use sys.platform.startswith() for these OSes. For

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: FreeBSD or OpenBSD release major version frequently, something like one per year, or one per two years. FreeBSD and OpenBSD developers knows that

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: sys.platform refers to build time information, so the platform module won't help. When I wrote my patch, I realized that sys.platform is used to get the runtime information, which is wrong. See the tests in Lib/test/test_*.py:

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: sys.platform refers to build time information, so the platform module won't help. When I wrote my patch, I realized that sys.platform is used to

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: It is mostly to test FreeBSD major version, and it looks like Python is build on the same FreeBSD major version that it is running on. Maybe because on FreeBSD, most programs are compiled instead of using prebuild packages

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: STINNER Victor wrote: STINNER Victor victor.stin...@haypocalc.com added the comment: It is mostly to test FreeBSD major version, and it looks like Python is build on the same FreeBSD major version that it is running on. Maybe

[issue12795] Remove the major version from sys.platform

2011-08-22 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: But in general you are right: if you use system provided Python packages, chances are that your runtime OS version will be identical or very close to the build time OS version. I asked on #freebsd-fr: even with pkg_add, the

[issue12795] Remove the major version from sys.platform

2011-08-20 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: sys.platform contains the major system version. If you test the sys.platform value (e.g. sys.platform == 'linux2'), your program doesn't work anymore with the new system major version (e.g. Linux 3). This problem is common with

[issue12795] Remove the major version from sys.platform

2011-08-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: To have an idea of how much code has to be changed for the sys.platform change, there is the diffstat : $ diffstat sys_platform_without_major.patch Lib/ctypes/util.py |6 --

[issue12795] Remove the major version from sys.platform

2011-08-20 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12795 ___

[issue12795] Remove the major version from sys.platform

2011-08-20 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think this change should be much much smaller in scope. It was (nearly) agreed to drop the major version if the system is Linux. There is no consensus (that I'm aware of) to drop the major OS version for all systems. So I would propose

[issue12795] Remove the major version from sys.platform

2011-08-20 Thread Nadeem Vawda
Changes by Nadeem Vawda nadeem.va...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12795 ___ ___

[issue12795] Remove the major version from sys.platform

2011-08-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: At the beginning, I thaught that it would be better to remove the major version from sys.platform on all platforms. When I started to write the patch, I expected to change only 2 or 3 files. But the patch is now huge (26 files