classification
Title: multiprocessing/darwin: sysctl(8) mislocation
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: brian.curtin, jnoller, python-dev, ronaldoussoren, sdaoden
Priority: normal Keywords: patch

Created on 2011-03-16 12:03 by sdaoden, last changed 2011-03-16 13:49 by ronaldoussoren. This issue is now closed.

Files
File name Uploaded Description Edit
multiproc_sysctl.patch sdaoden, 2011-03-16 12:03
multiproc_sysctl.patch sdaoden, 2011-03-16 12:40
Messages (6)
msg131104 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-03-16 12:03
Hello Mac OS X gurus, multiprocessing/__init__py. searches for
sysctl(8) via os.popen(), which will fail since the moist fruits
provide sysctl(8) in /usr/sbin!
The applied patch multiproc_sysctl.patch uses an absolute path.
(This may be better anyway, what do you think of that???)
msg131107 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-03-16 12:40
Maybe i should have used 'hg anno' first ...
next time i will.
This new patch always uses an absolute path.
I have not looked into os.popen() yet, but i do
put trust in that it makes a difference :)
The reason was nonetheless:


13:29 ~/usr/opt $ python3 -E -Wd -m test -r -w test_multiprocessing
[1/1] test_multiprocessing
/bin/sh: sysctl: command not found
/bin/sh: sysctl: command not found
/bin/sh: sysctl: command not found
1 test OK.
msg131108 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-03-16 13:00
The patch looks fine.  I'd prefer the second patch as this always uses an absolute path (I've ran into numerous problems in the past with scripts that assumed that the commands they looked for where on $PATH and were the system version instead of some local override).

Jesse, what's your opinion on w.r.t. this patch?
msg131110 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2011-03-16 13:13
Ronald - if you're OK w/ patch 2, please commit!
msg131113 - (view) Author: Roundup Robot (python-dev) Date: 2011-03-16 13:47
New changeset c394f2d42ff8 by Ronald Oussoren in branch '3.1':
Issue #11569: use absolute path to the sysctl command in multiprocessing to
http://hg.python.org/cpython/rev/c394f2d42ff8

New changeset b8f280d0cdbf by Ronald Oussoren in branch '2.7':
Issue #11569: use absolute path to the sysctl command in multiprocessing to
http://hg.python.org/cpython/rev/b8f280d0cdbf
msg131114 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-03-16 13:49
Thanks for the patch.

I've committed it to 2.7 as well.
History
Date User Action Args
2011-03-16 13:49:01ronaldoussorensetstatus: open -> closed

type: behavior
versions: + Python 2.7
nosy: ronaldoussoren, jnoller, brian.curtin, sdaoden, python-dev
messages: + msg131114
resolution: fixed
stage: resolved
2011-03-16 13:47:50python-devsetnosy: + python-dev
messages: + msg131113
2011-03-16 13:13:50jnollersetnosy: ronaldoussoren, jnoller, brian.curtin, sdaoden
messages: + msg131110
2011-03-16 13:00:09ronaldoussorensetnosy: + jnoller, ronaldoussoren
messages: + msg131108
2011-03-16 12:40:37sdaodensetfiles: + multiproc_sysctl.patch
versions: + Python 3.1, Python 3.2
nosy: + brian.curtin, - ronaldoussoren, ned.deily

messages: + msg131107
2011-03-16 12:03:49sdaodencreate