Full Changelog: v0.30.0...v0.31.0
Features
Cancelled
strings can now display the source and reason for a cancellation. Trio-internal sources of cancellation will set this string, andCancelScope.cancel
now has areason
string parameter that can be used to attach info to anyCancelled
to help in debugging. (#3232)
Bugfixes
- Make ctrl+c work in more situations in the Trio REPL (
python -m trio
). (#3007) - Allow pickling
trio.Cancelled
, as they can show up when you want to pickle something else. This does not rule out pickling otherNoPublicConstructor
objects -- create an issue if necessary. (#3248) - Decrease import time on Windows by around 10%. (#3263)
- Handle unwrapping SystemExit/KeyboardInterrupt exception gracefully in utility function
raise_single_exception_from_group
that reraises last exception from group. (#3275) - Ensure that the DTLS server does not mutate SSL context. (#3277)
- Avoid having
trio.as_safe_channel
raise if closing the generator wrapped
GeneratorExit
in aBaseExceptionGroup
. (#3324)
Deprecations and removals
- Implement
bool(trio.Event)
and have it raise aDeprecationWarning
and tell users to usetrio.Event.is_set
instead. This is an alternative tomypy --enable-error-code=truthy-bool
for users who don't use type checking. (#3322)
Miscellaneous internal changes
- When misnesting nurseries you now get a helpful
RuntimeError
instead of a catastrophicTrioInternalError
. (#3307)