[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #27030 [Core Tor/Stem]: Potential py3 compatibility issue with LinkProtocol



#27030: Potential py3 compatibility issue with LinkProtocol
-------------------------------+--------------------
     Reporter:  dmr            |      Owner:  atagar
         Type:  defect         |     Status:  new
     Priority:  Medium         |  Milestone:
    Component:  Core Tor/Stem  |    Version:
     Severity:  Normal         |   Keywords:  client
Actual Points:                 |  Parent ID:
       Points:                 |   Reviewer:
      Sponsor:                 |
-------------------------------+--------------------
 Seeing what looks to be a py3 compatibility issue with #26432.
 ([[https://gitweb.torproject.org/stem.git/commit/?id=24206c3b7301ed2fbd2a0bd539f951453dea5684|24206c3b7301ed2fbd2a0bd539f951453dea5684]])
 Test output for py35:
 {{{
 test_attributes                                              [FAILURE]
 ...
 test_use_as_int                                              [FAILURE]

 ======================================================================
 ERROR: test_attributes
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/path/to/test/unit/client/link_protocol.py", line 17, in
 test_attributes
     self.assertEqual(Size.SHORT, protocol.circ_id_size)
   File "/usr/lib/python3.5/unittest/case.py", line 821, in assertEqual
     assertion_func(first, second, msg=msg)
   File "/usr/lib/python3.5/unittest/case.py", line 811, in
 _baseAssertEqual
     if not first == second:
   File "/path/to/stem/client/datatype.py", line 326, in __eq__
     return hash(self) == hash(other) if isinstance(other, Field) else
 False
 TypeError: unhashable type: 'Size'

 ======================================================================
 FAIL: test_use_as_int
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/path/to/test/unit/client/link_protocol.py", line 33, in
 test_use_as_int
     self.assertEqual(1, protocol / 3)
 AssertionError: 1 != 1.6666666666666667

 ----------------------------------------------------------------------
 Ran 4 tests in 0.001s

 FAILED (failures=1, errors=1)

 ...

 TESTING FAILED (8 seconds)
   [UNIT TEST] test_attributes
 (test.unit.client.link_protocol.TestLinkProtocol) ... ERROR
   [UNIT TEST] test_use_as_int
 (test.unit.client.link_protocol.TestLinkProtocol) ... FAIL
 }}}
 py27 tests pass.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27030>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs