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

Process.groupname doesn't work on Windows 7 #70

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

Process.groupname doesn't work on Windows 7 #70

giampaolo opened this issue May 23, 2014 · 7 comments

Comments

@giampaolo
Copy link
Owner

From billiej...@gmail.com on January 26, 2010 23:35:35

>>> import psutil, os
>>> psutil.Process(os.getpid()).groupname
''
>>>

Note that for returning the empty string it takes about 10 seconds.
The slowness is caused by NetUserGetLocalGroups(), presumably because of
something related with name resolutions.
If LG_INCLUDE_INDIRECT is replaced with a "0" it returns immediately but
that doesn't solve the problem anyway.

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

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on January 27, 2010 11:24:54

Summary: Process.groupname doesn't work on Windows 7
Status: Accepted

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on February 10, 2010 12:10:22

I solved the hanging problem in r475 . NetUserGetLocalGroups now returns immediately
altough an empty string is still returned.

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on February 10, 2010 12:10:56

More progresses: there was no error handling for NetUserGetLocalGroups.
I checked its returning value and used PyErr_SetFromWindowsErr() ( r476 ) and now a
WindowsError exception is raised instead of having an empty string in return.

By doing some more dubbing I discovered that the real culprit is get_proc_username()
function which returns a wrong username (in my case "Administrators", while the user
owning the process is "giampaolo") so that is why get_proc_groupname() is currently
failing.

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on February 10, 2010 12:11:16

Blockedon: 63

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on February 17, 2010 11:41:42

A comment related to this issue can be found here: 
https://code.google.com/p/psutil/issues/detail?id=14&can=1&colspec=ID%20Summary%20Type%20Opsys%20Status%20Milestone%20Opened%20Owner%20Progress#c20

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on February 17, 2010 11:46:39

We decided to remove groupname functionnality.

Status: WontFix

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:51:04

Updated csets after the SVN -> Mercurial migration: r475 == revision 946561250dc6 r476 == revision 90e3b291077e

Blockedon: -psutil:63 psutil:63

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