PFZheng / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Windows 2000 support #117

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Not sure how Windows 2000 support was in 0.1.3 version but this is the current 
situation:

======================================================================
ERROR: test_zombie_process (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test\test_psutil.py", line 710, in test_zombie_process
    self.assertRaises(psutil.NoSuchProcess, getattr, p, "username")
  File "C:\Python27\lib\unittest\case.py", line 456, in assertRaises
    callableObj(*args, **kwargs)
  File "C:\Python27\lib\site-packages\psutil\__init__.py", line 263, in username
    self._procinfo.username =  self._platform_impl.get_process_username(self.pid)
  File "C:\Python27\lib\site-packages\psutil\_psmswindows.py", line 113, in wrapper
    return callable(self, pid, *args, **kwargs)
  File "C:\Python27\lib\site-packages\psutil\_psmswindows.py", line 163, in get_process_username
    return _psutil_mswindows.get_process_username(pid);
WindowsError: [Error 87] Parametro non corretto

======================================================================
ERROR: test_pid_4 (_windows.WindowsSpecificTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Documents and Settings\foo\Desktop\psutil\test\_windows.py", line 39, in test_pid_4
    p = psutil.Process(4)
  File "C:\Python27\lib\site-packages\psutil\__init__.py", line 136, in __init__
    raise NoSuchProcess(pid, None, "no process found with PID %s" % pid)
NoSuchProcess: no process found with PID 4

======================================================================
FAIL: test_process_names (_windows.WindowsSpecificTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Documents and Settings\foo\Desktop\psutil\test\_windows.py", line 64, in test_process_names
    self.assertTrue(p.name.endswith(".exe") or p.name.endswith(".bin"))
AssertionError: False is not True

----------------------------------------------------------------------

Original issue reported on code.google.com by g.rodola on 16 Oct 2010 at 7:50

GoogleCodeExporter commented 9 years ago
What's with the last test case? In Windows any file with any/no extension can 
be run.

Original comment by wj32...@gmail.com on 16 Oct 2010 at 10:30

GoogleCodeExporter commented 9 years ago
This is now fixed in r688 and r689.
Out of curiosity I've tried 0.1.3 version on Windows 2000 and there were a lot 
of failures so we might say that we added support in 0.2.0.

> What's with the last test case? In Windows any file with any/no extension 
> can be run.

That test was failing because the process name was in upper case (".EXE").
Aside from pids 0 and 4 I've always seen only processes with ".exe" or ".bin" 
extensions.
Do you think the test is unreliable?

Original comment by g.rodola on 17 Oct 2010 at 8:30

GoogleCodeExporter commented 9 years ago
I don't understand the purpose of the test, because you can rename executables 
to anything and run them. This happens most often with installers - you will 
see names like "D3F92B.tmp".

Original comment by wj32...@gmail.com on 18 Oct 2010 at 5:19

GoogleCodeExporter commented 9 years ago
I agree on pulling the exe/bin test. There are definitely instances where I've 
seen files with other extensions being run (I've seen more than my share of 
viruses using .tmp files for one), and there's really no reason for us to check 
the file extension on a running process anyway.

Original comment by jlo...@gmail.com on 18 Oct 2010 at 1:26

GoogleCodeExporter commented 9 years ago
Test removed in r702.
Closing this out as fixed.

Original comment by g.rodola on 18 Oct 2010 at 5:30

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 18 Oct 2010 at 5:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Updated csets after the SVN -> Mercurial migration:
r688 == revision 6ae3bea6ffdf
r702 == revision bf797a071d12

Original comment by g.rodola on 2 Mar 2013 at 11:55