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

TypeError: SelectorEventLoop required, instead got: <uvloop.Loop running=False closed=False debug=False> #10106

Closed
twisted-trac opened this issue Mar 1, 2021 · 5 comments

Comments

@twisted-trac
Copy link

tonal's avatar @tonal reported
Trac ID trac#10106
Type defect
Created 2021-03-01 04:26:06Z

Twisted versionn 21.02
uvloop version 0.15.2

Traceback:

Traceback (most recent call last):
  File "/home/user/projects/test/venv/lib/python3.9/site-packages/scrapy/utils/reactor.py", line 66, in install_reactor
    asyncioreactor.install(eventloop=event_loop)
  File "/home/user/projects/test/venv/lib/python3.9/site-packages/twisted/internet/asyncioreactor.py", line 307, in install
    reactor = AsyncioSelectorReactor(eventloop)
  File "/home/user/projects/test/venv/lib/python3.9/site-packages/twisted/internet/asyncioreactor.py", line 60, in __init__
    raise TypeError(
TypeError: SelectorEventLoop required, instead got: <uvloop.Loop running=False closed=False debug=False>

Python 3.8
Os: Ubuntu 20.04 with all upgrades

Searchable metadata
trac-id__10106 10106
type__defect defect
reporter__tonal tonal
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__core core
keywords__regression_review regression review
time__1614572766304584 1614572766304584
changetime__1622316521526448 1622316521526448
version__None None
owner__Wim_Lewis__wiml_____ Wim Lewis <wiml@...>

@twisted-trac
Copy link
Author

tonal's avatar @tonal commented

See also: [https://github.com/scrapy/scrapy/issues/5017#issuecomment-787935098 Scrapy issues #5017 comment 787935098]

@twisted-trac
Copy link
Author

kwist-sgr's avatar @kwist-sgr commented

See also: [ticket:10039 asyncioreactor interop with uvloop?]

@twisted-trac
Copy link
Author

wiml's avatar @wiml commented

This is presumably fallout from ticket:9766 in which asyncioreactor broke on Windows.

Probably Twisted shouldn't be making a inheritance-based test, but should (imho) test for the existence of add_reader() etc., or conformance to a protocol, or if that doesn't work the test could be changed to reject ProactorEventLoop instead of only accepting SelectorEventLoop.

To be honest I'm not sure if it's important to have that type assertion in AsyncioSelectorReactor.__init__() anywway.

@twisted-trac
Copy link
Author

AndreyMZ's avatar @AndreyMZ commented

PR for review: #1601

@twisted-trac
Copy link
Author

wiml's avatar @wiml set owner to @wiml
@wiml set status to closed

In changeset fd036b7

#!CommitTicketReference repository="" revision="fd036b78650c97bddc7201cff741b82259cd84d5"
Merge pull request #1601 from AndreyMZ/10106-andreymz-fix-typeerror-uvloop

Author: AndreyMZ
Reviewer: wiml
Fixes: ticket:10106

Fix exception "TypeError: SelectorEventLoop required, instead got: <uvloop.Loop ...>"

JudgeGregg pushed a commit to JudgeGregg/twisted that referenced this issue Sep 2, 2022
… got: <uvloop.Loop running=False closed=False debug=False>".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant