webbrowser: fix compatibility with trio 0.25 #5895
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #5893
Breaking changes in
trio
's0.25
release (apparently the last breaking change before their first stable release):https://github.com/python-trio/trio/releases/tag/v0.25.0
Add the
exceptiongroup
dependency directly to Streamlink, so we can writeExceptionGroup
handling code on all supported versions of Python without having to rely ontrio
's conditional dependency.trio
to0.25
,so we don't have to set
strict_exception_groups
toTrue
on older versions (probably not even possible viapytest-trio
)trio>=0.25
:Since
strict_exception_groups
now defaults toTrue
, trio nurseries now always raise anExceptionGroup
in all cases, so update tests and handle exception groups instead. Don't unwrap exception groups for now, even if only a single exception is included.Explicitly handle
KeyboardInterrupt
/SystemExit
and re-raise by using theexceptiongroup.catch
utility (<py311 compat)It's a bit annoying having to include the
exceptiongroup
dependency, but there's no other way around this. Python 3.11'sexcept*
syntax can't be used and making Python 3.11 the min requirement of the whole project because of this doesn't make sense. Python 3.10 reaches its EOL on 2026-10-31, so the added dependency will have to stay until then.It'll probably make sense preparing a patch release because of these changes within the next couple of days, so we don't cause any unnecessary blockers on Linux distros where only the latest version gets packaged (e.g. Arch) - in case they will re-build packages depending on trio.