Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p.username does not work in windows #84

Closed
giampaolo opened this issue May 23, 2014 · 5 comments
Closed

p.username does not work in windows #84

giampaolo opened this issue May 23, 2014 · 5 comments

Comments

@giampaolo
Copy link
Owner

From rpjan...@gmail.com on March 27, 2010 12:57:45

What steps will reproduce the problem?  
1. 2. 3. 

What is the expected output?  


What do you see instead?  
------------------------------------------------------------------------

Python 3.1.2 ( r312 :79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import psutil
>>> p = psutil.Process(3100)
>>> p.name
'Apache.exe'
>>>
>>> p.username
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python31\lib\site-packages\psutil\__init__.py", line 240, in
username
    self._procinfo.username =  _platform_impl.get_process_username(self.pid)
  File "C:\Python31\lib\site-packages\psutil\_psmswindows.py", line 106, in
get_process_username
    raise NotImplementedError("This functionnality requires pywin32 " \
NotImplementedError: This functionnality requires pywin32 extension to be
installed
------------------------------------------------------------------------
 What version of psutil are you using? On what operating system? checked with both:
psutil-0.1.3.win32-py3.1.exe
psutil-0.1.3.win32-py2.6.exe Please provide any additional information below.

Original issue: http://code.google.com/p/psutil/issues/detail?id=84

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on March 27, 2010 06:59:26

Look at the error:
"This functionnality requires pywin32 extension to be installed"

@giampaolo
Copy link
Owner Author

From rpjan...@gmail.com on March 29, 2010 01:34:58

I am just wondering what it is and why that kind of special thing is required in
windows, Can you please explain this..?

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on March 29, 2010 06:31:55

You can read about the pywin32 extensions here: 
http://starship.python.net/crew/mhammond/win32/ It's a commonly used module for Windows programming with Python, exposing a large
amount of Windows functionality to Python that would otherwise be unavailable. In
this specific case, the process username is not implemented in psutil's C code due to
a number of reasons that have been discussed elsewhere in the issue tracker.

Rather than leaving out process username information completely from psutil, we have
implemented it through WMI using the pywin32 extensions, if they are
installed/available on the user's system. Otherwise, you'll receive a
NotImplementedError exception with an appropriate error message, as you've seen.

Labels: OpSys-Windows

@giampaolo
Copy link
Owner Author

From g.rodola on May 06, 2010 17:06:56

Closing this out as invalid since the expected behavior is respected.

Status: Invalid

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:52:36

Updated csets after the SVN -> Mercurial migration: r312 == revision aac49c3913a2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant