Comments (10)
man you fucking rock. im gonna go over this and see what's up. I'm aware something broke in twisted but I stalled the downgrade because 22.10 doesn't seem stable on my machine. I needed that nudge to dig deeper 🙏
from ilua.
I'm getting the same problem on Python 3.12.1. I updated to Fedora 39 and suddenly ilua does not work.
$ ilua
Jupyter console 6.6.3
ILua 0.2.1
In [1]: 2023-12-13T14:39:40+0100 [ilua.kernel.ILuaKernel#critical] Uncought exception in message handler
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/twisted/internet/defer.py", line 2000, in _inlineCallbacks
result = context.run(gen.send, result)
File "/usr/lib/python3.12/site-packages/ilua/kernelbase.py", line 196, in handle_message
content = yield self.do_is_complete(**msg['content'])
File "/usr/lib/python3.12/site-packages/twisted/internet/defer.py", line 2256, in unwindGenerator
return _cancellableInlineCallbacks(gen)
File "/usr/lib/python3.12/site-packages/twisted/internet/defer.py", line 2168, in _cancellableInlineCallbacks
_inlineCallbacks(None, gen, status, _copy_context())
--- <exception caught here> ---
File "/usr/lib/python3.12/site-packages/ilua/kernelbase.py", line 196, in handle_message
content = yield self.do_is_complete(**msg['content'])
File "/usr/lib/python3.12/site-packages/twisted/internet/defer.py", line 2000, in _inlineCallbacks
result = context.run(gen.send, result)
File "/usr/lib/python3.12/site-packages/ilua/kernel.py", line 179, in do_is_complete
result = yield self.proto.sendRequest({"type": "is_complete",
builtins.AttributeError: 'ILuaKernel' object has no attribute 'proto'
/usr/lib/python3.12/site-packages/jupyter_console/ptshell.py:787: UserWarning: The kernel did not respond to an is_complete_request. Setting `use_kernel_is_complete` to False.
warn('The kernel did not respond to an is_complete_request. '
In [1]:
from ilua.
downgrading twisted to 22.10 makes it work
from ilua.
FWIW it seems that this is called:
Lines 104 to 105 in 05eb181
And before the self.proto
attribute is set, other methods (such as do_is_complete
) proceed and fail.
from ilua.
I've tried bisecting this and I belive the problem started with twisted/twisted#1675
from ilua.
Adding usePTY=1
to this call forces fork-based process and makes it work.
I don't know yet why it does not work with posix_spawn or whether there is a nicer way to force fork.
Lines 96 to 100 in 05eb181
from ilua.
Setting self.reactor._neverUseSpawn = True
(which is obviously a hack) also works.
EDIT: That's what I did for now in the Fedora package.
from ilua.
hi guys can you try this snapshot:
https://github.com/guysv/ilua/releases/tag/0.2.1%2Bpass.env.explicit.1
after failing with 22.10, i noticed there's some failed assertion for env-var read (interp.lua:8)
tried to do e68fadb. works for me. give it a try and report back?
this works even with latest twisted
from ilua.
@guysv, e68fadb works for me. I've seen reproduction of exception above, and with manually patched kernel.py
the exception gone.
from ilua.
nice. looks like some time during twisted's transition to spawn-by-default subprocessing, their wrapper stopped implicitly passing current process environment to the child, which looks like I assumed. copying the dict seems like a reasonable workaround. Mac seems to be not stable at all still. need to dig into that before a release i guess.
from ilua.
Related Issues (20)
- Ctrl-C Interrupt Support HOT 5
- What exactly is required from the custom lua interpreter? HOT 5
- Operation not permitted when piping in stdin HOT 2
- No such kernel named lua HOT 4
- RFE: A way to pass additional help_links from kernel.json HOT 3
- Install error on macOS HOT 4
- Installing to Jupyter's kernelspec? HOT 2
- Implement a backend running the kernel in the same process using lupa HOT 1
- Got error in jupyter lab HOT 19
- Exception 'coroutine' object is not subscriptable on typing anything HOT 11
- How to pip install ilua in specify lua version? HOT 4
- ilua in fedora 34 no docstrings, only ? HOT 1
- how to quit/close/exit ilua? HOT 2
- Exit cleanly when no Lua executable found HOT 1
- Tab-completion crashes HOT 7
- The included "inspect" module poorly respects __tostring metamethods
- Docstring crashing shell HOT 3
- printing HOT 7
- Passing ipython command line arguments HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ilua.