Skip to content

Pin prompt-toolkit>=3.0.43 to fix TypeError on Python 3.12#1206

Draft
ericholscher wants to merge 1 commit intomainfrom
fix-prompt-toolkit-py312
Draft

Pin prompt-toolkit>=3.0.43 to fix TypeError on Python 3.12#1206
ericholscher wants to merge 1 commit intomainfrom
fix-prompt-toolkit-py312

Conversation

@ericholscher
Copy link
Copy Markdown
Member

Summary

  • Older versions of prompt-toolkit pass bare coroutines to asyncio.wait(), which raises TypeError on Python 3.12+ (coroutines were deprecated in 3.8, became an error in 3.12)
  • prompt-toolkit is a transitive dependency via celeryclick-repl
  • Pins prompt-toolkit>=3.0.43 which wraps coroutines with ensure_future() before passing to asyncio.wait()

Error

File "prompt_toolkit/renderer.py", line 514, in wait_for_cpr_responses
    await wait(coroutines, return_when=FIRST_COMPLETED)
TypeError: Passing coroutines is forbidden, use tasks explicitly.

Test plan

  • Verify celery starts without the TypeError on Python 3.12

Older versions of prompt-toolkit pass bare coroutines to
asyncio.wait() which raises TypeError on Python 3.12+.
This is a transitive dependency via celery -> click-repl.
Copy link
Copy Markdown
Collaborator

@davidfischer davidfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built the image and verified celery started and ran correctly with this change.

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

Successfully merging this pull request may close these issues.

2 participants