Closed julianfritzsch closed 2 years ago
I am using Kitty 0.24.4 under MacOS 12.3 with Python 3.8.13 installed with Conda and Matplotlib 3.5.1
This module currently relies on running kitty +kitten icat --print-window-size
as a subprocess. On kitty 0.24.4, this seems to fail with the following, at least on my end:
$ kitty +kitten icat --print-window-size
Traceback (most recent call last):
File "/nix/store/hb1lzaisgx2m9n29hqhh6yp6hasplq1v-python3-3.9.10/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/nix/store/hb1lzaisgx2m9n29hqhh6yp6hasplq1v-python3-3.9.10/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/__main__.py", line 185, in <module>
main()
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/__main__.py", line 176, in main
namespaced(['+', first_arg[1:]] + sys.argv[2:])
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/__main__.py", line 129, in namespaced
func(args[1:])
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/__main__.py", line 112, in run_kitten
rk(kitten)
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/kittens/runner.py", line 120, in run_kitten
runpy.run_module(f'kittens.{kitten}.main', run_name=run_name)
File "/nix/store/hb1lzaisgx2m9n29hqhh6yp6hasplq1v-python3-3.9.10/lib/python3.9/runpy.py", line 213, in run_module
return _run_code(code, {}, init_globals, run_name, mod_spec)
File "/nix/store/hb1lzaisgx2m9n29hqhh6yp6hasplq1v-python3-3.9.10/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/kittens/icat/main.py", line 613, in <module>
main()
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/kittens/icat/main.py", line 518, in main
ss = screen_size_function(tty)()
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/kitty/utils.py", line 176, in __call__
self.ans = read_screen_size(self.fd)
File "/nix/store/difdrdflm2al35f1pqmqkkazrkfaxqm8-kitty-0.24.4/bin/../lib/kitty/kitty/utils.py", line 156, in read_screen_size
if fd < 0:
TypeError: '<' not supported between instances of '_io.TextIOWrapper' and 'int'
So this looks like a regression in kitty's tooling, for which someone has already opended an issue upstream: https://github.com/kovidgoyal/kitty/issues/4900
I'll leave this open until upstream rolls out a fix.
Actually, this seems to have already been fixed on kitty master: https://github.com/kovidgoyal/kitty/pull/4818
So you could wait for 0.24.5 to be released, run kitty nightly in the meantime, or downgrade.
Interestingly, with kitty 0.25.0 it works when using iPython but using a Jupyter console it still gives the same error.
kitty 0.25.0 and 0.25.1 have been released and are likely available in most distros' repos by now; both of them seem to work fine on my end. My thanks go out to @nertro for fixing this issue upstream.
Hi @julianfritzsch , I just want to ask if you have found any solution for this error on Jupyter Console?
Hi, unfortunately it does not work with the Jupyter console for me but I get an error
Error: Failed to open controlling terminal with error: open /dev/tty: device not configured
However, it works perfectly fine with iPython for me
Hi, I'm getting the following error trying to use the package:
ValueError: invalid literal for int() with base 10: ''
Here is the full stack traceI am using Kitty 0.24.4 under MacOS 12.3 with Python 3.8.13 installed with Conda and Matplotlib 3.5.1