I just took this example directly from Autobahn, saved it as a Python script, then transferred it to a Debian 9 distribution running Python 3.5.3.
I'm trying to convert this file into an executable binary.
I saved the file as defer4.py
. I then ran:
cython --embed -o defer4.c defer4.py;
gcc -Os -I /usr/include/python3.5m -o defer4 defer4.c -lpython3.5m -lpthread -lm -lutil -ldl
This created an executable called defer4
in the same folder. I then run ./defer4
and get this error:
2018-04-17T21:20:56-0400 connecting once using transport type "websocket" over endpoint "tcp"
2018-04-17T21:20:56-0400 Starting factory <autobahn.twisted.websocket.WampWebSocketClientFactory object at 0xb5a8c730>
2018-04-17T21:20:56-0400 While notifying 'join': Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/autobahn/wamp/protocol.py", line 508, in success
d = self.fire('join', self, details)
File "/usr/local/lib/python3.5/dist-packages/autobahn/util.py", line 817, in fire
res.append(self._parent.fire(event, *args, **kwargs))
File "/usr/local/lib/python3.5/dist-packages/autobahn/util.py", line 814, in fire
future = txaio.as_future(handler, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/txaio/tx.py", line 417, in as_future
return maybeDeferred(fun, *args, **kwargs)
--- <exception caught here> ---
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/defer.py", line 1531, in unwindGenerator
"instead got %r" % (f, gen))
builtins.TypeError: inlineCallbacks requires <cyfunction join at 0xb5a68030> to produce a generator; instead got <generator object at 0xb5a49300>
2018-04-17T21:20:56-0400 Unhandled error in Deferred:
2018-04-17T21:20:56-0400 Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/autobahn/wamp/protocol.py", line 508, in success
d = self.fire('join', self, details)
File "/usr/local/lib/python3.5/dist-packages/autobahn/util.py", line 817, in fire
res.append(self._parent.fire(event, *args, **kwargs))
File "/usr/local/lib/python3.5/dist-packages/autobahn/util.py", line 814, in fire
future = txaio.as_future(handler, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/txaio/tx.py", line 417, in as_future
return maybeDeferred(fun, *args, **kwargs)
--- <exception caught here> ---
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/defer.py", line 1531, in unwindGenerator
"instead got %r" % (f, gen))
builtins.TypeError: inlineCallbacks requires <cyfunction join at 0xb5a68030> to produce a generator; instead got <generator object at 0xb5a49300>
2018-04-17T21:20:56-0400 Unhandled error in Deferred:
2018-04-17T21:20:56-0400 Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/autobahn/wamp/protocol.py", line 508, in success
d = self.fire('join', self, details)
File "/usr/local/lib/python3.5/dist-packages/autobahn/util.py", line 817, in fire
res.append(self._parent.fire(event, *args, **kwargs))
File "/usr/local/lib/python3.5/dist-packages/autobahn/util.py", line 814, in fire
future = txaio.as_future(handler, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/txaio/tx.py", line 417, in as_future
return maybeDeferred(fun, *args, **kwargs)
--- <exception caught here> ---
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/usr/local/lib/python3.5/dist-packages/twisted/internet/defer.py", line 1531, in unwindGenerator
"instead got %r" % (f, gen))
builtins.TypeError: inlineCallbacks requires <cyfunction join at 0xb5a68030> to produce a generator; instead got <generator object at 0xb5a49300>
I've been going through some of the docs to find out if there's something about the new Python that might be creating an issue, or if new Python is changing the way it's handling deferreds / generators. I cannot find anything yet.
Do you know why this issue is being caused even by Autobahn's own example?