python3 compatibility
Tried to pick a sensible policy for when bytes/str.
This is WIP because two tests are failing:
servo:~/ligo/src/nds/nds2-distributed-server [py3] 0$ python3 -m unittest
...F..................../usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 52513)>
method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 37004), raddr=('127.0.0.1', 52513)>
method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
./usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 58675)>
method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 40080)>
method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
.......................................F.............................................
======================================================================
FAIL: test_reader (nds2-server.reader.tests.test_reader.TestReader)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jrollins/ligo/src/nds/nds2-distributed-server/nds2-server/reader/tests/test_reader.py", line 95, in test_reader
self.assertEqual(float(cur), struct.unpack("!f", dat[0:4])[0])
AssertionError: 0.0 != 1.003549101196609e-35
======================================================================
FAIL: test_get_frame_priorities (nds2-server.tests.test_planner.TestPlannerMatrix)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jrollins/ligo/src/nds/nds2-distributed-server/nds2-server/tests/test_planner.py", line 770, in test_get_frame_priorities
self.do_test_frame_priorities(
File "/home/jrollins/ligo/src/nds/nds2-distributed-server/nds2-server/tests/test_planner.py", line 407, in do_test_frame_priorities
self.assertEqual(m.get_column_frame_priority(i), exp_priority)
AssertionError: Lists differ: ['FR1', 'FR2', 'FR3'] != ['FR2', 'FR1', 'FR3']
First differing element 0:
'FR1'
'FR2'
- ['FR1', 'FR2', 'FR3']
+ ['FR2', 'FR1', 'FR3']
----------------------------------------------------------------------
Ran 110 tests in 0.130s
FAILED (failures=2)
servo:~/ligo/src/nds/nds2-distributed-server [py3] 1$
also note the unittest resource warnings:
/usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 52513)>
method()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Edited by Jameson Rollins