You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. import psutil
2. p = psutil.Process(0)
3. p.set_cpu_affinity([0])
What is the expected output?
Sets an affinity for process spawned via call to: osutil.execute(...)
What do you see instead?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\Python\Python27\lib\site-packages\psutil\__init__.py", line 346, in
set_cpu_affinity
return self._platform_impl.set_process_cpu_affinity(cpus)
File "c:\Python\Python27\lib\site-packages\psutil\_psmswindows.py", line 145, in wrapper
raise AccessDenied(self.pid, self._process_name)
psutil.error.AccessDenied: (pid=0, name='System Idle Process')
What version of psutil are you using? What Python version?
psutil 0.5
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
On what operating system? Is it 32bit or 64bit version?
Win7 x64 SP1
Please provide any additional information below.
As described in Issue #238 this should be possible.
Not sure what problem you are referring to here.
Is PID 0 supposed to be an alias for "set an affinity for spawned process in advance"?
Is that stated somewhere?
I can't see anything like that in "man sched_setaffinity" on Ubuntu 12.04.
Yes, it is - unfortunately I cannot find a corresponding document at the moment.
I guess it should be sufficient to call:
psutil.Process(os.getpid()) and then start subprocess.
That would seem to be more likely.
Also, even if PID 0 has the meaning you are suggesting, psutil is not
misbehaving in raising AccessDenied: it just means you don't have the
permission to perform that particular action (sched_setaffinity(3) call) in
which case you might try to use the root user and see what happens.
Closing out as invalid for now. If you find any reference to PID 0 please reopen.
From maciej.l...@gmail.com on June 28, 2012 15:31:05
Original issue: http://code.google.com/p/psutil/issues/detail?id=291
The text was updated successfully, but these errors were encountered: