[tor-bugs] #14844 [Stem]: Added Windows Support for Connection Resolution

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Feb 16 18:31:35 UTC 2015


#14844: Added Windows Support for Connection Resolution
------------------------------+--------------------
     Reporter:  icodemachine  |      Owner:  atagar
         Type:  enhancement   |     Status:  new
     Priority:  major         |  Milestone:
    Component:  Stem          |    Version:
   Resolution:                |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |
------------------------------+--------------------

Comment (by atagar):

 Very nice! Patch looks good and I'm tempted to merge, but there's a few
 issues at present...

 1. This doesn't pass stylistic checks since you're using tabs. Please
 install pyflakes and pep8 and you should see the issues...

 {{{
 * /home/atagar/Desktop/stem/test/integ/util/system.py
   line 218  - W293 W293 blank line contains whitespace
   line 218  - E101 E101 indentation contains mixed spaces and tabs
   line 218  - W191 W191 indentation contains tabs
   line 218  - indentation has a tab
   line 219  - E101 E101 indentation contains mixed spaces and tabs
   line 224  - local variable 'runner' is assigned to but never used
   line 239  - E303 E303 too many blank lines (2)

 * /home/atagar/Desktop/stem/test/integ/util/connection.py
   line 43   - line has trailing whitespace
   line 67   - indentation has a tab
   line 67   - E101 E101 indentation contains mixed spaces and tabs
   line 67   - W191 W191 indentation contains tabs
   line 68   - E101 E101 indentation contains mixed spaces and tabs
   line 92   - W291 W291 trailing whitespace

 ... etc...
 }}}

 2. In the unit tests you aren't mocking the new tasklist calls so the
 tests cause inadvertent system calls on windows and fail elsewhere...

 {{{
 ======================================================================
 ERROR: test_pid_by_name_lsof
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/usr/local/lib/python2.7/dist-packages/mock.py", line 1201, in
 patched
     return func(*args, **keywargs)
   File "/home/atagar/Desktop/stem/test/unit/util/system.py", line 259, in
 test_pid_by_name_lsof
     self.assertEqual(expected_response, system.pid_by_name(test_input))
   File "/home/atagar/Desktop/stem/stem/util/system.py", line 458, in
 pid_by_name
     raise IOError("No results found for tasklist")
 IOError: No results found for tasklist
 }}}

 3. Integ tests fail for me with the following. Your addition should
 probably be wrapped with an 'if windows' check...

 {{{
 ======================================================================
 ERROR: test_pid_by_name
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/atagar/Desktop/stem/test/integ/util/system.py", line 89, in
 test_pid_by_name
     self.assertEqual(None,
 stem.util.system.pid_by_name('blarg_and_stuff'))
   File "/home/atagar/Desktop/stem/stem/util/system.py", line 477, in
 pid_by_name
     raise IOError("Unable to query '%s': %s" % (command, exc))
 IOError: Unable to query 'tasklist | findstr blarg_and_stuff.exe.exe':
 [Errno 2] No such file or directory
 }}}

 4. Some of your changes to system.py look to be breaking our python3
 compatibility. Please install python3 and ensure the tests still work
 under that too.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/14844#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list