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
open_files does find out doc files opened by ms office word on windows. #542
Comments
open_files() on Windows is broken and I'll probably remove it in the next major version |
Open_files on Windows is very useful, if you don't want to fix it, at least, please keep it. |
I investigated this a bit and it seems that this condition is responsible for the doc files getting missed: handle.GrantedAccess == 0x0012019f I noticed on a different open_files related defect you had mentioned that you are unable to recollect the original source of these access permissions related code: By any chance, was it this source: Further, I think I have been able to find what the particular code 0x0012019f stands for with the help of this blog: so basically referring to the winnt.h, 0x0012019f seems to stand for: Meanwhile, after I recompiled the latest psutil after removing the check for 0x0012019f, I was able to get the document in my listing, now need to check if that causes any hangs on some other processes though. Will try to run the test suite and let you know. Comments? Thoughts? |
Ran the tests. ======================================================================
FAIL: test_halfway_terminated_process (__main__.TestProcess)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_psutil.py", line 2025, in test_halfway_terminated_process
self.fail("NoSuchProcess exception not raised for %r" % name)
AssertionError: NoSuchProcess exception not raised for 'num_ctx_switches'
======================================================================
FAIL: test_fetch_all (__main__.TestFetchAllProcesses)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_psutil.py", line 2227, in test_fetch_all
self.fail(''.join(failures))
AssertionError:
======================================================================
FAIL: test_connections (proc=psutil.Process(pid=1472), ret=[pconn(fd=-1, family=2, type=2, laddr=('10.0.2.15', 1900), raddr=(), status='NONE'), pconn(fd=-1, family=2, type=2, laddr=('127.0.0.1', 1900), raddr=(), status='NONE'), pconn(fd=-1, family=2, type=2, laddr=('0.0.0.0', 3702), raddr=(), status='NONE'), pconn(fd=-1, family=2, type=2, laddr=('0.0.0.0', 3702), raddr=(), status='NONE'), pconn(fd=-1, family=2, type=2, laddr=('0.0.0.0', 54042), raddr=(), status='NONE'), pconn(fd=-1, family=2, type=2, laddr=('10.0.2.15', 54945), raddr=(), status='NONE'), pconn(fd=-1, family=2, type=2, laddr=('127.0.0.1', 54946), raddr=(), status='NONE'), pconn(fd=-1, family=23, type=2, laddr=('::1', 1900), raddr=(), status='NONE'), pconn(fd=-1, family=23, type=2, laddr=('fe80::8427:f3c6:d887:925e', 1900), raddr=(), status='NONE'), pconn(fd=-1, family=23, type=2, laddr=('::', 3702), raddr=(), status='NONE'), pconn(fd=-1, family=23, type=2, laddr=('::', 3702), raddr=(), status='NONE'), pconn(fd=-1, family=23, type=2, laddr=('::', 54043), raddr=(), status='NONE'), pconn(fd=-1, family=23, type=2, laddr=('fe80::8427:f3c6:d887:925e', 54943), raddr=(), status='NONE'), pconn(fd=-1, family=23, type=2, laddr=('::1', 54944), raddr=(), status='NONE')]))
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_psutil.py", line 2213, in test_fetch_all
meth(ret)
File "test\test_psutil.py", line 2344, in connections
self.assertEqual(len(ret), len(set(ret)))
File "e:\python279\lib\unittest\case.py", line 513, in assertEqual
assertion_func(first, second, msg=msg)
File "e:\python279\lib\unittest\case.py", line 506, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 14 != 12
======================================================================
FAIL: test_memory_info_ex (proc=psutil.Process(pid=0, name='System Idle Process'), ret=pextmem(num_page_faults=0, peak_wset=0, wset=12288, peak_paged_pool=0, paged_pool=0, peak_nonpaged_pool=0, nonpaged_pool=0, pagefile=0, peak_pagefile=0, private=0)))
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_psutil.py", line 2213, in test_fetch_all
meth(ret)
File "test\test_psutil.py", line 2326, in memory_info_ex
assert ret.peak_wset >= ret.wset, ret
AssertionError: pextmem(num_page_faults=0, peak_wset=0, wset=12288, peak_paged_pool=0, paged_pool=0, peak_nonpaged_pool=0, nonpaged_pool=0, pagefile=0, peak_pagefile=0, private=0)
----------------------------------------------------------------------
Ran 182 tests in 4.705s
FAILED (failures=2, skipped=79) |
I'm wondering if the file mask should just be exposed at the Python layer so people can mix and match the appropriate masks to ignore for their systems. |
open_files does find out doc files opened by ms office word on windows. Is that "Skip handles" code block missed anything?
I tried Sysinternals handle.exe, that can get it.
The text was updated successfully, but these errors were encountered: