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

Uvloop broken in 3.11 #177

Open
Paradigm00 opened this issue Feb 8, 2024 · 2 comments
Open

Uvloop broken in 3.11 #177

Paradigm00 opened this issue Feb 8, 2024 · 2 comments

Comments

@Paradigm00
Copy link

Hello
I tested this code almost 2 weeks ago and was everything ok, now something is broken.

The following code block is resulting in an error:

Error in Scraper._process(): TypeError: 'Task' object is not callable

def test_t1(self):
        a = Scraper(session=init_session())
        b = a.users(['elonmusk'])
Exception in callback <Task pending name='Task-1' coro=<Scraper._process() running at [PATH]/venv/lib/python3.11/site-packages/twitter/scraper.py:603> cb=[run_until_complete.<locals>.done_cb()]>
handle: <Handle <Task pending name='Task-1' coro=<Scraper._process() running at [PATH]/venv/lib/python3.11/site-packages/twitter/scraper.py:603> cb=[run_until_complete.<locals>.done_cb()]>>
Traceback (most recent call last):
 File "uvloop/cbhandles.pyx", line 61, in uvloop.loop.Handle._run
TypeError: 'Task' object is not callable

Removing uvloop.install() or placing asyncio.get_event_loop_policy().new_event_loop() before the rest of the code allows the test to pass.
However, these fixes are not working for my actual project, which is built around asyncio, where it still fails and throws another error: Can't patch loop of type <class 'uvloop.Loop'>.
how can i resolve this?

thank you

@takabinance
Copy link

I have this same issue with Python 3.10.

It was working until about a week ago. I'm assuming some dependency somewhere got updated on my side.

@takabinance
Copy link

removing uvloop code works for me for now

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

2 participants