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

Console addon is broken on Python 3.11 #124

Closed
JamiKettunen opened this issue Dec 1, 2022 · 4 comments
Closed

Console addon is broken on Python 3.11 #124

JamiKettunen opened this issue Dec 1, 2022 · 4 comments
Labels
addon Addon-related issues (legacy tag, no longer supported by the launcher) enhancement New feature or request

Comments

@JamiKettunen
Copy link
Contributor

The game still launches but the console addon breaks with no logs at all visible and portablemc command exiting with code 1, here's what's left in the terminal:

[  OK  ] Username: ... (...)
Traceback (most recent call last):
  File "/bin/portablemc", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc/cli.py", line 145, in main
    cmd(handler, ns)
  File "/usr/lib/python3.11/site-packages/portablemc/cli.py", line 350, in cmd
    handler(ns, new_context(ns))
  File "/usr/lib/python3.11/site-packages/portablemc/cli.py", line 800, in wrapper
    return func(orig_func, *w_args, **w_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc_quilt/__init__.py", line 29, in cmd_start
    return old(ns, ctx)
           ^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc/cli.py", line 800, in wrapper
    return func(orig_func, *w_args, **w_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc_forge/__init__.py", line 30, in cmd_start
    return old(ns, ctx)
           ^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc/cli.py", line 800, in wrapper
    return func(orig_func, *w_args, **w_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc_fabric/__init__.py", line 29, in cmd_start
    return old(ns, ctx)
           ^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc/cli.py", line 800, in wrapper
    return func(orig_func, *w_args, **w_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc_archives/__init__.py", line 80, in cmd_start
    return old(ns, ctx)
           ^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc/cli.py", line 558, in cmd_start
    start.start()
  File "/usr/lib/python3.11/site-packages/portablemc/__init__.py", line 813, in start
    self.runner([
  File "/usr/lib/python3.11/site-packages/portablemc_console/__init__.py", line 43, in runner_wrapper
    runner(old_runner, bin_dir, args, cwd, ctx.ns, start)
  File "/usr/lib/python3.11/site-packages/portablemc_console/__init__.py", line 151, in runner
    asyncio.get_event_loop().run_until_complete(_run())
  File "/usr/lib/python3.11/asyncio/base_events.py", line 650, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portablemc_console/__init__.py", line 141, in _run
    _done, _pending = await asyncio.wait((
                      ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/tasks.py", line 415, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
sys:1: RuntimeWarning: coroutine 'Application.run_async' was never awaited
sys:1: RuntimeWarning: coroutine 'runner.<locals>._run_process' was never awaited

Relevant package versions (on Void Linux x86_64-glibc):

python3-3.11.0_1
python3-wcwidth-0.2.5_5
python3-prompt_toolkit-3.0.33_1
portablemc-console-2.0.0_1

Let me know if I can help somehow else! This is also reproducible on Alpine Linux with pip install portablemc portablemc-console and portablemc start where Python 3.11 transition was just performed recently.

@JamiKettunen JamiKettunen changed the title Console plugin is broken (on Python 3.11?) Console addon is broken (on Python 3.11?) Dec 1, 2022
@mindstorm38
Copy link
Owner

Looks like an issue with Python 3.11 on how async works :/ I'll check the changelog

@mindstorm38
Copy link
Owner

From python doc:

Changed in version 3.11: Passing coroutine objects to wait() directly is forbidden.

So yes, I'll need to learn again how async works because I use it like once a year lol

@JamiKettunen JamiKettunen changed the title Console addon is broken (on Python 3.11?) Console addon is broken on Python 3.11 Dec 4, 2022
@mindstorm38
Copy link
Owner

I can't get it to work, even when creating task as said by the error message, maybe prompt_toolkit in the version we are using is not compatible.

@mindstorm38 mindstorm38 added enhancement New feature or request addon Addon-related issues (legacy tag, no longer supported by the launcher) labels Jan 12, 2023
mindstorm38 added a commit that referenced this issue Apr 4, 2023
There is a problem with the Python >=3.6.2 requirement, because newer versions (after 3.0.36) of prompt-toolkit are not available.
@mindstorm38
Copy link
Owner

Fixed in latest version 2.0.1!

mindstorm38 added a commit that referenced this issue Apr 4, 2023
* Fixed prompt_toolkit for python 3.11 by manually creating tasks from coroutines
* Console add-on version 2.0.1, now supporting python 3.11 (#124).

There is a problem with the Python >=3.6.2 requirement, because newer versions (after 3.0.36) of prompt-toolkit are not available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon Addon-related issues (legacy tag, no longer supported by the launcher) enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants