Skip to content

Python 3.13 support #208

Open
Open

Description

@dimaqq

Bug Description

)> jhack show-relation hexanator:send-ca-cert
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /code/jhack/jhack/utils/show_relation.py:980 in sync_show_relation                               │
│                                                                                                  │
│    977 │   - ``$ jhack utils show-relation my_app:peers`` - peer relation\n                      │
│    978 │   - ``$ jhack utils show-relation my_app:foo cross_model_app:bar`` - CMRs\n             │
│    979 │   """                                                                                   │
│ ❱  980 │   return _sync_show_relation(                                                           │
│    981 │   │   endpoint1=endpoint1,                                                              │
│    982 │   │   endpoint2=endpoint2,                                                              │
│    983 │   │   n=n,                                                                              │
│                                                                                                  │
│ ╭──────────────────── locals ────────────────────╮                                               │
│ │               color = 'auto'                   │                                               │
│ │           endpoint1 = 'hexanator:send-ca-cert' │                                               │
│ │           endpoint2 = None                     │                                               │
│ │              format = <Format.auto: 'auto'>    │                                               │
│ │ hide_empty_databags = False                    │                                               │
│ │               model = None                     │                                               │
│ │                   n = None                     │                                               │
│ │      show_juju_keys = False                    │                                               │
│ │               watch = False                    │                                               │
│ ╰────────────────────────────────────────────────╯                                               │
│                                                                                                  │
│ /code/jhack/jhack/utils/show_relation.py:1019 in _sync_show_relation                             │
│                                                                                                  │
│   1016 │   while True:                                                                           │
│   1017 │   │   start = time.time()                                                               │
│   1018 │   │                                                                                     │
│ ❱ 1019 │   │   table = asyncio.run(                                                              │
│   1020 │   │   │   render_relation(                                                              │
│   1021 │   │   │   │   endpoint1,                                                                │
│   1022 │   │   │   │   endpoint2,                                                                │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │               color = 'auto'                                                                 │ │
│ │             Console = <class 'rich.console.Console'>                                         │ │
│ │             console = <console width=181 ColorSystem.TRUECOLOR>                              │ │
│ │           endpoint1 = 'hexanator:send-ca-cert'                                               │ │
│ │           endpoint2 = None                                                                   │ │
│ │              format = <Format.auto: 'auto'>                                                  │ │
│ │ hide_empty_databags = False                                                                  │ │
│ │               model = None                                                                   │ │
│ │                   n = None                                                                   │ │
│ │                rich = <module 'rich' from                                                    │ │
│ │                       '/code/jhack/.ahh-venv/lib/python3.13/site-packages/rich/__init__.py'> │ │
│ │      show_juju_keys = False                                                                  │ │
│ │               start = 1741588711.6658273                                                     │ │
│ │               watch = False                                                                  │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /home/dima.linux/.local/share/uv/python/cpython-3.13.0-linux-aarch64-gnu/lib/python3.13/asyncio/ │
│ runners.py:194 in run                                                                            │
│                                                                                                  │
│   191 │   │   │   "asyncio.run() cannot be called from a running event loop")                    │
│   192 │                                                                                          │
│   193 │   with Runner(debug=debug, loop_factory=loop_factory) as runner:                         │
│ ❱ 194 │   │   return runner.run(main)                                                            │

To Reproduce

py 3.13 venv
jhack show-relation hexanator:send-ca-cert

Environment

...

Relevant log output

...

Additional context

...

Activity

  1. dimaqq commented on Mar 10, 2025

    @dimaqq
    ContributorAuthor

    Basically, starting from some Python version, it's no longer legal to go async -> sync -> async

  2. dimaqq commented on Jul 1, 2025

    @dimaqq
    ContributorAuthor

    The asyncio.run was a red herring.
    The actual error is:

    RuntimeError: No relation found matching spec 'invalid/0' -> None in model '<the current model>'. Verify that you haven't misspelled any app/saas/endpoint names. apps ['invalid'] not found in model '<the current model>'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions