Hello all,
Maybe this is a duplicate of Issue 252:
I am using psutil on a Windows 7 64 bit box, but the following code
snippet:
for p in psutil.process_iter():
if
p.name == 'explorer.exe':
print p.pid, p.getcwd()
prints `3944 C:\Windows\system32` in a 64 bit Python session, while it
raises NoSuchProcess in a 32 bit Python session opened at the same
time (I mean that process 3944 is still alive while writing those
lines).
When running the following code:
import psutil
results = dict()
for p in psutil.process_iter():
name =
p.name
if name not in results:
results[name] = dict(pid=[p.pid], error=[])
else:
results[name]['pid'].append(p.pid)
try:
a = p.getcwd()
except psutil.NoSuchProcess:
results[name]['error'].append('NSP')
except psutil.AccessDenied:
results[name]['error'].append('AD')
else:
results[name]['error'].append(None)
def lower_cmp(x, y):
if x.lower() == y.lower():
return 0
elif x.lower() < y.lower():
return - 1
return 1
pnames = results.keys()
for pname in pnames:
if 'NSP' in results[pname]['error']:
print pname
print ' ', results[pname]['pid']
print ' ', results[pname]['error']
I get no output on my 64 bit Python, but only programs tagged as 64
bit by Windows Task Manager in my 32 bit Python (not all the tagged as
64 bit it seems, but no program tagged as 32 bit for sure).
Any help more than welcome, as using only 64 bit Python is not an
option for me...
Best regards,
LFay