holzschu / holzschu/a-shell

Bug: Textual crashes when running a textual python app (very strange!)👀

Open
#692 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
3.9k
Forks
213
Avg merge
1m
Merged PRs (30d)
1

Description

To reproduce this bug in a-Shell you need to install Textual and Textual-dev:

https://pypi.org/project/textual/

https://pypi.org/project/textual-dev/

Then you need to try to run a script of a textual app via `"textual run script.py"` like this for example:

[test textual.zip](https://github.com/holzschu/a-shell/files/12469902/test.textual.zip)

And here is what happens:

```
[~/Documents]$ textual
Usage: textual [OPTIONS] COMMAND [ARGS]...

Options:
--version Show the version and exit.
--help Show this message and exit.

Commands:
borders Explore the border styles available in Textual.
colors Explore the design system.
console Run the Textual Devtools console.
diagnose Print information about the Textual environment.
easing Explore the animation easing functions available in Textual.
keys Show key events.
run Run a Textual app.
[~/Documents]$
[~/Documents]$ ls
select.tcss select_widget.py
[~/Documents]$ textual run select_widget.py
[~/Documents]$ textual run --dev select_widget.py
Fatal Python error: pyinit_core_reconfigure: failed to read thread state
Python runtime state: initialized

Thread 0x000000016da17000 (most recent call first):
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/selectors.py", line 561 in select
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/base_events.py", line 1876 in _run_once
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/base_events.py", line 607 in run_forever
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/base_events.py", line 640 in run_until_complete
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/runners.py", line 118 in run
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/runners.py", line 190 in run
File "/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/Library/lib/python3.11/site-packages/textual/app.py", line 1313 in run
File "/private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/Documents/select_widget.py", line 27 in
[~/Documents]$
[~/Documents]$ select_widget.py
Fatal Python error: pyinit_core_reconfigure: failed to read thread state
Python runtime state: initialized

Thread 0x000000016da17000 (most recent call first):
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/selectors.py", line 561 in select
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/base_events.py", line 1876 in _run_once
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/base_events.py", line 607 in run_forever
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/base_events.py", line 640 in run_until_complete
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/runners.py", line 118 in run
File "/private/var/containers/Bundle/Application/87621026-4603-46BA-9B34-2EE4014FF869/a-Shell.app/Library/lib/python3.11/asyncio/runners.py", line 190 in run
File "/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/Library/lib/python3.11/site-packages/textual/app.py", line 1313 in run
File "/private/var/mobile/Containers/Data/Application/5896FDC4-A93C-4F95-B6E0-41EAF01171C3/Documents/select_widget.py", line 27 in
[~/Documents]$ 
```

Not only it doesn't run, but
- first it crashes silently,
- then it crashes with error
- and finally running the script now crashes even if launched by itself!! (It worked perfectly fine before!)

Very strange!🤯😳😱👾👀

P.S.
Not to mention that the only way to debug a textual app is using textual-dev and run command. If this bug doesn't get fixed no textual apps can be debugged in a-shell!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.