@ralph there is just one thing I am not sure about... will Python 3 fedmsg feed us messages containing str or bytes? It seems like in Python 2 we were getting str which we decoded to unicode. But surely in Python 3 we get str? That's what I have assumed in the resultsdb consumer test cases here.
str
bytes
unicode
rebased onto 08f064b6bddc740fcda55d5553475efd8ebd35f5
rebased onto d37cc1b522b4713d17ad2989f71717ea86479aa3
Amended a few things around the Jenkinsfile. This version now passes the tests in Jenkins.
Would len(updates) work?
len(updates)
+1 Nice! You can also change py27 in tox.ini.
py27
tox.ini
I'd assume we also get a str in python3.
:+1: from me too pending @lholecek's tox.ini suggestion.
Would you believe, I had no idea that you could take the len() of a dict!
Amended per @lholecek 's suggestions. Thanks!
3 new commits added
resultsdb consumer: emit messages in consistent order
switch to Python 3
Jenkinsfile: tidy up package installation for functional tests
Pull-Request has been merged by lholecek
Hmm. So this broke the message consumers, now they busy-loop with this exception...
File "/usr/lib64/python3.6/site-packages/twisted/internet/posixbase.py", line 602, in _doReadOrWrite why = selectable.doWrite() File "/usr/lib64/python3.6/site-packages/twisted/internet/tcp.py", line 586, in doConnect self._connectDone() File "/usr/lib64/python3.6/site-packages/twisted/internet/tcp.py", line 615, in _connectDone self.protocol.makeConnection(self) File "/usr/lib64/python3.6/site-packages/twisted/protocols/tls.py", line 313, in makeConnection ProtocolWrapper.makeConnection(self, transport) File "/usr/lib64/python3.6/site-packages/twisted/protocols/policies.py", line 75, in makeConnection self.wrappedProtocol.makeConnection(self) File "/usr/lib64/python3.6/site-packages/twisted/internet/protocol.py", line 490, in makeConnection self.connectionMade() File "/usr/lib/python3.6/site-packages/moksha/hub/stomp/protocol.py", line 97, in connectionMade self.transport.write(cmd) File "/usr/lib64/python3.6/site-packages/twisted/protocols/tls.py", line 557, in write raise TypeError("Must write bytes to a TLS transport, not unicode.") builtins.TypeError: Must write bytes to a TLS transport, not unicode.
Seems like a Moksha bug or fedmsg bug, I guess.... Does that mean we are the first to use Moksha + STOMP + Python 3? Probably we are...
See #224.