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

KeyError exception raised when Trio task is cancelled #260

Open
seidnerj opened this issue Aug 13, 2023 · 0 comments
Open

KeyError exception raised when Trio task is cancelled #260

seidnerj opened this issue Aug 13, 2023 · 0 comments

Comments

@seidnerj
Copy link
Contributor

seidnerj commented Aug 13, 2023

When using quart-trio, with the versions specified below, if a Trio task is cancelled, a KeyError("Custom exceptions must be subclasses of Exception.") exception is raised. This is because "trio.Cancelled" class is defined as "class Cancelled(BaseException, metaclass=NoPublicConstructor)", i.e. it does not inherit from Exception, but rather from BaseException (from which Exception inherits).

This causes some strange behavior, which may or may not be related tome hang issues I'm experiencing. I assume this is a bug which is why I am submitting this.

This might also require changes in quart-trio to accommodate BaseException everywhere instead of Exception though I am not certain.

Environment:

  • Python version: 3.11.4
  • Quart version: 0.18.4
  • Quart-trio version: 0.10.0
  • Trio version: 0.22.0
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