[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: > this does sound very ugly. > > so we get now another mostly unmaintained platform directory? > unfortunately the generated header files are almost never updated > during a releaes cycle. I would be +1 to deprecate this stuff, but that's quite separate from t

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: See issue #12619 for potential solution for platform-specific modules. -- ___ Python tracker ___ _

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread STINNER Victor
STINNER Victor added the comment: It's too late to "fix" sys.platform. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread Matthias Klose
Matthias Klose added the comment: this does sound very ugly. so we get now another mostly unmaintained platform directory? unfortunately the generated header files are almost never updated during a releaes cycle. and we repeat the mistakes that some constants differ on some architectures? --

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: I give up. Call it 'linux3', then. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-21 Thread Charles-François Natali
Charles-François Natali added the comment: > Still -1. It should be renamed to 'linux' in future releases, and > back-patched to 'linux2' for maintenance releases. > I really don't see any advantage to this solution: - sys.platform currently has a clear and documented value (OS name + major rel

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-21 Thread Martin v . Löwis
Martin v. Löwis added the comment: > I'm still in favor of keeping sys.platform == 'linux3', and you? Still -1. It should be renamed to 'linux' in future releases, and back-patched to 'linux2' for maintenance releases. As for releases that are already out - users should be informed to not use

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-21 Thread STINNER Victor
STINNER Victor added the comment: > It seems currently that in python 3.2 sys.platform is linux2 > even though it is running linux 3 It's maybe because you ran ./configure with Linux 2.x.y (see msg138254). Try make distclean && ./configure --with-debug && make. -- ___

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-21 Thread maniram maniram
maniram maniram added the comment: It seems currently that in python 3.2 sys.platform is linux2 even though it is running linux 3 -- nosy: +maniram.maniram ___ Python tracker _

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le mardi 19 juillet 2011 à 23:20 +, STINNER Victor a écrit : > STINNER Victor added the comment: > > > Your patch looks fine to me, except for this: > > -if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6', > > -'f

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-19 Thread STINNER Victor
STINNER Victor added the comment: > Your patch looks fine to me, except for this: > -if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6', > -'freebsd7', 'freebsd8') > -or platform.startswith("gnukfreebsd")): > +if os.uname()[0] in ('L

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Copying plat-linux2 to plat-linux3 should be just fine. Done in issue12571. -- ___ Python tracker ___ __

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-19 Thread Charles-François Natali
Charles-François Natali added the comment: > I'm still in favor of keeping sys.platform == 'linux3', and you? > So do I. > For plat-linux3, should we regenerate this directory (I cannot do that, I > don't have Linux 3.0 yet) or can we just use a symbolic link? I read that > Linux 3.0 doesn't b

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-15 Thread STINNER Victor
STINNER Victor added the comment: > Here we go, first Linux3-related bug report: > https://bugs.gentoo.org/show_bug.cgi?id=374579 (see issue #12571). Oh, some people use the DLFCN module :-) -- I'm still in favor of keeping sys.platform == 'linux3', and you? For plat-linux3, should we regene

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-15 Thread Charles-François Natali
Charles-François Natali added the comment: Here we go, first Linux3-related bug report: https://bugs.gentoo.org/show_bug.cgi?id=374579 (see issue #12571). -- ___ Python tracker

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-15 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman : -- nosy: +djc ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8bc9dbc61ba6 by Antoine Pitrou in branch '3.2': Issue #12326: document the recommended idiom for checking sys.platform on Unix systems. http://hg.python.org/cpython/rev/8bc9dbc61ba6 New changeset 19b3b2d93a63 by Antoine Pitrou in branch 'default':

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 53d2d30d6ca0 by Antoine Pitrou in branch '2.7': Issue #12326: document the recommended idiom for checking sys.platform on Unix systems. http://hg.python.org/cpython/rev/53d2d30d6ca0 -- nosy: +python-dev ___

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-09 Thread Matthias Klose
Matthias Klose added the comment: about the plat-*/ files: they are even wrong for some linux architectures, because some constants like the DLFCN constants have different values depending on the platform/architecture (can't find the issue proposing architecture dependent plat-linux2- direct

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > while this is sorted out, I propose to apply the following workaround > not to introduce `linux3', at least for the branches: It's too late, since existing versions won't have the patch and will show "linux3" when the kernel gets upgraded. I think we'd bette

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-09 Thread Matthias Klose
Matthias Klose added the comment: while this is sorted out, I propose to apply the following workaround not to introduce `linux3', at least for the branches: --- a/configure.in 2011-06-11 17:46:28.0 +0200 +++ b/configure.in 2011-06-19 22:32:05.852934453 +0200 @@ -293,6 +293,7

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-08 Thread Charles-François Natali
Charles-François Natali added the comment: > @neologix: I don't understand why do you want to hurry, this issue will not > be fixed in the next release (3.2.1, it's too late), and I don't think that > the next release (3.3? or is it something before?) will come before few > months. > Well, I

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-07-07 Thread STINNER Victor
STINNER Victor added the comment: @neologix: I don't understand why do you want to hurry, this issue will not be fixed in the next release (3.2.1, it's too late), and I don't think that the next release (3.3? or is it something before?) will come before few months. -- I don't think that repl

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le Mon, 27 Jun 2011 08:05:05 +, Martin v. Löwis a écrit : > > What I'm advocating is to special-case Linux (and any other system > where major version numbers don't mean much). Actually, it would itself break compatibility, because sys.platform would jump

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-27 Thread Martin v . Löwis
Martin v. Löwis added the comment: >> That would be incorrect for some systems. For example, FreeBSD does >> change sets of symbolic constants across system releases (mostly >> additions, but sometimes also removals). Back then, SunOS 4 and SunOS >> 5 were completely unrelated systems. >> > > W

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-26 Thread Charles-François Natali
Charles-François Natali added the comment: > That would be incorrect for some systems. For example, FreeBSD does > change sets of symbolic constants across system releases (mostly > additions, but sometimes also removals). Back then, SunOS 4 and SunOS > 5 were completely unrelated systems. > We

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-26 Thread Martin v . Löwis
Martin v. Löwis added the comment: > I can't speak, as I've never used those. But can't those directories > be renamed to Lib/plat-? That would be incorrect for some systems. For example, FreeBSD does change sets of symbolic constants across system releases (mostly additions, but sometimes also

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-26 Thread Charles-François Natali
Charles-François Natali added the comment: > So people who say sys.platform shouldn't be used: what do you propose > to do with Lib/plat-linux2 (or, more generally, Lib/plat-*)? I can't speak, as I've never used those. But can't those directories be renamed to Lib/plat-? As for the performance

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-22 Thread Éric Araujo
Éric Araujo added the comment: > the platform does external calls to system commands such as "uname", I guess it’s the platform module. -- ___ Python tracker ___ ___

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-22 Thread R. David Murray
R. David Murray added the comment: Indeed, the lib/plat- directories should continue to work just fine using linux3, correct? Or using linux, if we change sys.platform. (Note: just because we don't import them in the test suite doesn't mean that user code in the field isn't using them...I go

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: > So people who say sys.platform shouldn't be used: what do you propose to > do with Lib/plat-linux2 (or, more generally, Lib/plat-*)? These directories look useless to me. (IIRC, putting an obvious syntax error there does not trigger any failure in the regress

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-21 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- nosy: +petri.lehtinen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-21 Thread Martin v . Löwis
Martin v. Löwis added the comment: > What are these directories? Look and see for yourself. > Are they still used? Sure. If you do "import DLFCN", it will come from that directory. -- ___ Python tracker __

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-20 Thread STINNER Victor
STINNER Victor added the comment: > what do you propose to do with Lib/plat-linux2 > (or, more generally, Lib/plat-*)? What are these directories? Are they still used? -- ___ Python tracker __

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-20 Thread Martin v . Löwis
Martin v. Löwis added the comment: So people who say sys.platform shouldn't be used: what do you propose to do with Lib/plat-linux2 (or, more generally, Lib/plat-*)? -- ___ Python tracker

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-20 Thread Ross Lagerwall
Ross Lagerwall added the comment: > That's exactly my point. > Code checking sys.platform against 'linux2' is already broken, there's > no point in complicating the code further, or adding a new constant. > If you want to check for a specific operating system, there's already > platform.system()

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-20 Thread Charles-François Natali
Charles-François Natali added the comment: > However, it appears to me that vast majority of them is broken anyway, > because what they really mean to check is That's exactly my point. Code checking sys.platform against 'linux2' is already broken, there's no point in complicating the code furth

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-18 Thread Éric Araujo
Éric Araujo added the comment: IOW, they should check os.name == 'posix'? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-18 Thread Jakub Wilk
Jakub Wilk added the comment: Just to give some statistic, in Debian we have >80 binary packages that check if sys.platform is linux2. However, it appears to me that vast majority of them is broken anyway, because what they really mean to check is: - is this a non-Windows sytem? or - is this a

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-17 Thread Éric Araujo
Éric Araujo added the comment: Martin’s sys.platform = 'linux' sounds good to me too. -- nosy: +eric.araujo ___ Python tracker ___ __

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-14 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > The change to sys.platform=='linux' would break code even on current > > platforms. > > Correct. Compared to introducing 'linux3', I consider this the better > change - it likely breaks earlier (i.e. when porting to Python 3.3). FWIW, I also agree that sy

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-14 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > >> The change to sys.platform=='linux' would break code even on current >> platforms. > > Correct. Compared to introducing 'linux3', I consider this the better > change - it likely breaks e

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-14 Thread Charles-François Natali
Charles-François Natali added the comment: > I'm sure Linus Torvalds is fully aware of the possible > consequences of the version change, and just accepted the breakage > that this would cause. Any application relying on sys.platform == 'linux2' is already broken. It's exactly the same if an ap

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: > The change to sys.platform=='linux' would break code even on current > platforms. Correct. Compared to introducing 'linux3', I consider this the better change - it likely breaks earlier (i.e. when porting to Python 3.3). > OTOH, we have sys.platform=='win3

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The change to sys.platform=='linux' would break code even on current platforms. OTOH, we have sys.platform=='win32' even on Windows 64bit; would this favor keeping 'linux2' on all versions of Linux as well? -- ___

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: > This change is reasonable for the long term. But it *will* break a lot of > code. [If you favor a specific change, please indicate what that is. I'm assuming you support my proposal for the moment :-] I agree it will break a lot of code, but it's also som

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: This change is reasonable for the long term. But it *will* break a lot of code. -- nosy: +amaury.forgeotdarc ___ Python tracker ___

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Ross Lagerwall
Changes by Ross Lagerwall : -- nosy: +rosslagerwall ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: I suggest to change sys.platform to 'linux' in future releases (3.3). For bugfix releases (2.7, 3.2), I'd keep it as 'linux2' even on Linux 3. For security-only releases (2.6, 3.1), no change should be made. -- __

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Charles-François Natali
Changes by Charles-François Natali : -- nosy: +lemburg, loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Charles-François Natali
Charles-François Natali added the comment: > I would expect changing sys.platform will also break a lot of third- > party code. Maybe, but this would be an application bug. Here's sys.platform current implementation: const char * Py_GetPlatform(void) { return PLATFORM; } And here's the

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: sys.platform comes from Py_GetPlatform() which comes from PLATFORM define. On Linux, this define comes from Makefile: MACHDEP variable which comes from configure. Finally, MACHDEP is defined by: ac_sys_system=`uname -s` if test "$ac_sys_system

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would expect changing sys.platform will also break a lot of third-party code. Perhaps sys.platform can still be 'linux2' under Linux 3.x? After all, there's no significant change that deserves changing sys.platform. -- nosy: +pitrou ___

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: Why should be used instead? - sys.platform.startswith('linux') - os.uname()[0] == 'Linux' - platform.system() == 'Linux' - other? Tests like sys.platform in ('linux2', 'darwin') can be replaced by sys.platform in ('linux2', 'linux3', 'darwin'). We will hav

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-13 Thread Charles-François Natali
New submission from Charles-François Natali : Linus recently decided that the next Linux kernel version would 3.0 [1]. As a consequence, sys.platform (which is actually MACHDEP) will be 'linux3' on machines running Linux 3 kernels, and tests checking explicitely against 'linux2' will either bre