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
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
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,
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
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
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:
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
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
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
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
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
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 --
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12795
___
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
Changes by Nadeem Vawda nadeem.va...@gmail.com:
--
nosy: +nadeem.vawda
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12795
___
___
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
16 matches
Mail list logo