Merge lp:~mbp/bzr/trivial into lp:bzr

Proposed by Martin Pool
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 6096
Proposed branch: lp:~mbp/bzr/trivial
Merge into: lp:bzr
Diff against target: 12 lines (+1/-1)
1 file modified
bzrlib/osutils.py (+1/-1)
To merge this branch: bzr merge lp:~mbp/bzr/trivial
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+72659@code.launchpad.net

Commit message

fix 'bzr serve' invocation in admin guide

Description of the change

If the Python interpreter is compiled (not run) on a Linux 3.0 kernel, it reports sys.platform == linux3.

Apparently this is patched-around in Ubuntu (or maybe not, looking at the changelog.) At any rate saying .startswith('linux') should do for the next while.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

ps, in theory this ought to be fixed in all series, but since this only affects test parallelism (and maybe harmlessly?), and since I can't actually reproduce the problem on Ubuntu's python, I've proposed it only to trunk for now.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/24/2011 6:37 AM, Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/trivial into lp:bzr.
>
> Requested reviews: bzr-core (bzr-core) Related bugs: Bug #66336 in
> Bazaar: "Unportable test(1) construct"
> https://bugs.launchpad.net/bzr/+bug/66336 Bug #394649 in Bazaar:
> "NameError raising error in ReadVFile.readline()"
> https://bugs.launchpad.net/bzr/+bug/394649 Bug #408814 in Bazaar:
> "test_breakin known failure with "subprocess wasn't terminated, it
> had to be killed"" https://bugs.launchpad.net/bzr/+bug/408814 Bug
> #545185 in Bazaar: "Last character of path stripped in result
> message" https://bugs.launchpad.net/bzr/+bug/545185 Bug #644221 in
> Bazaar: "bzr help bugs references an old now stale url for squid
> bugzilla" https://bugs.launchpad.net/bzr/+bug/644221 Bug #804553 in
> Bazaar: ""version doesn't match" warning doesn't indicate bzr
> location" https://bugs.launchpad.net/bzr/+bug/804553
>
> For more details, see:
> https://code.launchpad.net/~mbp/bzr/trivial/+merge/72659
>
> If the Python interpreter is compiled (not run) on a Linux 3.0
> kernel, it reports sys.platform == linux3.
>
> Apparently this is patched-around in Ubuntu (or maybe not, looking
> at the changelog.) At any rate saying .startswith('linux') should
> do for the next while.

 merge: approve

I've been following through the threads. In theory, you don't need to
backport a fix. Because only people who are upgrading to a 3.0 kernel
are going to run into it.

python upstream still hasn't settled on whether they want to preserve
"linux2" because there isn't a significant update, or whether they
want to keep the documented "platform+major version" and break lots of
existing code.

I think the recommended fix is to actually use "import platform; ...?"

Anyway, I'm fine with this for now.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5UylQACgkQJdeBCYSNAANUaACdE095SsHMZNH5+PGG69TH/HgZ
aIYAoKDGV0n9RWZEtzS0hXG0KqcsNc+U
=eOBq
-----END PGP SIGNATURE-----

review: Approve
Revision history for this message
Martin Pool (mbp) wrote :

On 24 August 2011 19:54, John Arbash Meinel <email address hidden> wrote:

> I've been following through the threads. In theory, you don't need to
> backport a fix. Because only people who are upgrading to a 3.0 kernel
> are going to run into it.

Well, it's quite possible you'd want to test bzr 2.3 on a 3.0 kernel,
though perhaps less likely you'd want to test with a python built on a
3.0 kernel. I'll send it just to trunk for now.

Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Revision history for this message
John A Meinel (jameinel) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/osutils.py'
2--- bzrlib/osutils.py 2011-08-19 22:26:03 +0000
3+++ bzrlib/osutils.py 2011-08-24 04:37:29 +0000
4@@ -2255,7 +2255,7 @@
5 termios.tcsetattr(fd, termios.TCSADRAIN, settings)
6 return ch
7
8-if sys.platform == 'linux2':
9+if sys.platform.startswith('linux'):
10 def _local_concurrency():
11 try:
12 return os.sysconf('SC_NPROCESSORS_ONLN')