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

toolong crashes on startup #360671

Open
gaykitty opened this issue Dec 1, 2024 · 1 comment
Open

toolong crashes on startup #360671

gaykitty opened this issue Dec 1, 2024 · 1 comment
Labels
0.kind: bug Something is broken

Comments

@gaykitty
Copy link
Contributor

gaykitty commented Dec 1, 2024

Describe the bug

When trying to open a file in toolong it crashes with the error: AttributeError: 'UI' object has no attribute 'namespace_bindings'

/nix/store/0famzzgy6h067d4pbn4cdimn0sicf2rc-python3.11-textual-0.82.0/lib/python3.11/site-packages/textual/strip.py:92: RuntimeWarning: coroutine 'LogFooter.mount_keys' was never awaited
  self._segments = list(segments)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
╭───────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────╮
│ /nix/store/58mxzyzw6s8s6zysp6krg607xiziiw07-toolong-1.4.0/lib/python3.11/site-packages/toolong/log_view.py:2 │
│ 43 in watch_can_tail                                                                                         │
│                                                                                                              │
│   240 │   │   self.query(".tail").set_class(tail and self.can_tail, "on")                                    │
│   241 │                                                                                                      │
│   242 │   async def watch_can_tail(self, can_tail: bool) -> None:                                            │
│ ❱ 243 │   │   await self.mount_keys()                                                                        │
│   244 │                                                                                                      │
│   245 │   def watch_filename(self, filename: str) -> None:                                                   │
│   246 │   │   self.update_meta()                                                                             │
│                                                                                                              │
│ ╭──────── locals ────────╮                                                                                   │
│ │ can_tail = False       │                                                                                   │
│ │     self = LogFooter() │                                                                                   │
│ ╰────────────────────────╯                                                                                   │
│                                                                                                              │
│ /nix/store/58mxzyzw6s8s6zysp6krg607xiziiw07-toolong-1.4.0/lib/python3.11/site-packages/toolong/log_view.py:2 │
│ 05 in mount_keys                                                                                             │
│                                                                                                              │
│   202 │   │   │   │   await key_container.query("*").remove()                                                │
│   203 │   │   │   │   bindings = [                                                                           │
│   204 │   │   │   │   │   binding                                                                            │
│ ❱ 205 │   │   │   │   │   for (_, binding) in self.app.namespace_bindings.values()                           │
│   206 │   │   │   │   │   if binding.show                                                                    │
│   207 │   │   │   │   ]                                                                                      │
│   208                                                                                                        │
│                                                                                                              │
│ ╭─────────── locals ───────────╮                                                                             │
│ │ key_container = Horizontal() │                                                                             │
│ │          self = LogFooter()  │                                                                             │
│ ╰──────────────────────────────╯                                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'UI' object has no attribute 'namespace_bindings'

NOTE: 1 of 3 errors shown. Run with textual run --dev to see all errors.
sys:1: RuntimeWarning: coroutine 'LogFooter.watch_can_tail' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install toolong
  2. Open a file with it

Expected behavior

It should not crash.

Screenshots

Additional context

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.63, NixOS, 24.11 (Vicuna), 24.11.20241128.c71ad5c
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.10
  • channels(sasha): "nixos, nixpkgs"
  • channels(root): "nixos-23.05"
  • nixpkgs: /home/sasha/.nix-defexpr/channels/nixpkgs

Notify maintainers

@Sigmanificient

Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@gaykitty gaykitty added the 0.kind: bug Something is broken label Dec 1, 2024
@armijnhemel
Copy link
Contributor

Probably this is because toolong requires an older version of textual. In 0.61.0 namespace_bindings was removed:

https://github.com/Textualize/textual/blob/main/CHANGELOG.md

Breaking change: Renamed App.namespace_bindings to active_bindings

toolong hasn't been updated for a while it seems, but there is a PR that should fix it:

Textualize/toolong#63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants