Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception when RETURN pressed in a DataTable with no rows #1970

Closed
pkazmier opened this issue Mar 7, 2023 · 3 comments
Closed

Uncaught exception when RETURN pressed in a DataTable with no rows #1970

pkazmier opened this issue Mar 7, 2023 · 3 comments

Comments

@pkazmier
Copy link

pkazmier commented Mar 7, 2023

Uncaught exception CellDoesNotExist causes the application to crash if a user presses RETURN in a DataTable that has focus but no rows.

image

The sample app below demonstrates this behavior. Run it and press RETURN to cause the crash.

from textual.app import App, ComposeResult
from textual.widgets import DataTable


class Demo(App):
    def compose(self) -> ComposeResult:
        yield DataTable()

    def on_mount(self):
        self.set_focus(self.query_one(DataTable))


if __name__ == "__main__":
    Demo().run()

Output of textual diagnose below:

# Textual Diagnostics

## Versions

| Name    | Value  |
|---------|--------|
| Textual | 0.13.0 |
| Rich    | 13.3.1 |

## Python

| Name           | Value                                |
|----------------|--------------------------------------|
| Version        | 3.9.13                               |
| Implementation | CPython                              |
| Compiler       | Clang 13.1.6 (clang-1316.0.21.2)     |
| Executable     | /Users/kaz/tmp/textual/bin/python3.9 |

## Operating System

| Name    | Value                                                                                           |
|---------|-------------------------------------------------------------------------------------------------|
| System  | Darwin                                                                                          |
| Release | 22.3.0                                                                                          |
| Version | Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64 |

## Terminal

| Name                 | Value           |
|----------------------|-----------------|
| Terminal Application | tmux (next-3.4) |
| TERM                 | tmux-256color   |
| COLORTERM            | truecolor       |
| FORCE_COLOR          | *Not set*       |
| NO_COLOR             | *Not set*       |

## Rich Console options

| Name           | Value                |
|----------------|----------------------|
| size           | width=263, height=69 |
| legacy_windows | False                |
| min_width      | 1                    |
| max_width      | 263                  |
| is_terminal    | True                 |
| encoding       | utf-8                |
| max_height     | 69                   |
| justify        | None                 |
| overflow       | None                 |
| no_wrap        | False                |
| highlight      | None                 |
| markup         | None                 |
| height         | None                 |
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@pkazmier pkazmier changed the title Uncaught exception CellDoesNotExist when user presses RETURN in a DataTable with no rows Uncaught exception when RETURN pressed in a DataTable with no rows Mar 7, 2023
@pkazmier
Copy link
Author

Closing as this was resolved in #1973.

@github-actions
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant