Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Windows 7 64 - NoSuchProcess with Python 32 but no error with Python 64
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
lfay  
View profile  
 More options Mar 9 2012, 12:59 pm
From: lfay <l.fayo...@ymail.com>
Date: Fri, 9 Mar 2012 09:59:02 -0800 (PST)
Local: Fri, Mar 9 2012 12:59 pm
Subject: Windows 7 64 - NoSuchProcess with Python 32 but no error with Python 64
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Giampaolo Rodola'  
View profile  
 More options Mar 9 2012, 2:12 pm
From: Giampaolo Rodola' <g.rod...@gmail.com>
Date: Fri, 9 Mar 2012 11:12:27 -0800 (PST)
Local: Fri, Mar 9 2012 2:12 pm
Subject: Re: Windows 7 64 - NoSuchProcess with Python 32 but no error with Python 64

Hi,
ideed this would seem related to issue 252.
The only difference you would get by using the fixed version from SVN is
that AccessDenied would be raised instead of NoSuchProcess.
You wouldn't be able to get process cwd anyway though, so I'm not sure how
much this helps.

G.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lfay  
View profile  
 More options Mar 12 2012, 4:30 am
From: lfay <l.fayo...@ymail.com>
Date: Mon, 12 Mar 2012 01:30:02 -0700 (PDT)
Local: Mon, Mar 12 2012 4:30 am
Subject: Re: Windows 7 64 - NoSuchProcess with Python 32 but no error with Python 64
Hi,

Thanks for your answer. It helps to know that I will (reluctantly:
psutil was so convenient while I had to poll only 32-bit executables)
have to look for another way of doing things (the call to cwd allowed
me to tell the user on which file each process of a same executable
was opened on, which is more readable than a simple pid when choosing
which one he wants to take control of)...

Best regards,

LFay

On 9 mar, 20:12, Giampaolo Rodola' <g.rod...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lfay  
View profile  
 More options Mar 12 2012, 7:04 am
From: lfay <l.fayo...@ymail.com>
Date: Mon, 12 Mar 2012 04:04:46 -0700 (PDT)
Local: Mon, Mar 12 2012 7:04 am
Subject: Re: Windows 7 64 - NoSuchProcess with Python 32 but no error with Python 64
Hi,

I could solve this particular problem by using wmi (http://
pypi.python.org/pypi/WMI/) when needed.

Best regards,

LFay

On 12 mar, 09:30, lfay <l.fayo...@ymail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »