Skip to main content
1 vote
0 answers
41 views

Python Asyncio: Timed out during opening handshake

I keep getting a timeout error which I can't currently explain. I'm new to networking in Python, but I can create and interact with example websocket code. For some reason the code below hits a ...
mathPhys's user avatar
2 votes
1 answer
36 views

Scrapy Playwright freezes after initialization ([scrapy.middleware] INFO: Enabled item pipelines:[‘carscraper.pipelines.PostgreSQLPipeline’])

After starting a spider, there is the problem with freezing on a stage when pipeline must enable. There is no errors, just scrapy-playwrigth script, but it stopes on beggining before even starts ...
Max Plakushko's user avatar
6 votes
2 answers
214 views

Why does multiprocess with "fork" fail under Python 3.14 but work in 3.13 (works only with "spawn" and "forkserver")?

The following code works fine on Python 3.13, but fails on Python 3.14 with a RuntimeError related to asyncio tasks. If I switch the multiprocessing start method from "fork" to "spawn&...
DarkMath's user avatar
  • 1,500
1 vote
1 answer
51 views

FastAPI + pytest: RuntimeError: Event loop is closed when testing logout with AsyncClient

I'm testing a FastAPI application with asynchronous endpoints using pytest and httpx.AsyncClient. I have an endpoint /logout that depends on a JWT token from cookies and uses some async dependencies. ...
onesch's user avatar
  • 21
-2 votes
1 answer
39 views

Weird errors while trying to connect to Mega.NZ from Python via https://pypi.org/project/mega.py/ [closed]

I'm trying to connect to Mega.NZ via module https://pypi.org/project/mega.py/ with this code: #!/usr/bin/env python3 from mega import Mega mega = Mega() m = mega.login("my mail", "my ...
user216652's user avatar
-2 votes
1 answer
113 views

Use decorator to remove await prefix

I am working with Asyncio in an app I am making. However, I find it daunting to prefix my function calls with await. So I want to encapsulate it in a decorator that adds the wait to the function call. ...
Ephreal's user avatar
  • 2,167
0 votes
1 answer
108 views

python REPL: is it possible to combine -i and -m asyncio?

I was trying to start the asyncio REPL (python -m asyncio) and to execute a script before starting the interactive REPL (python -i ./script.py). I tried re-ordering of options, the end-of-options ...
VPfB's user avatar
  • 17.9k
2 votes
2 answers
76 views

Why is asyncio.gather returning results in a different order than my tasks?

I’m learning about asynchronous programming in Python and testing with asyncio. import asyncio import random async def worker(name): delay = random.randint(1, 3) await asyncio.sleep(delay) ...
Anuj Mishra's user avatar
0 votes
2 answers
73 views

asyncio.run with SQLAlchemy asyncio sessions works only once, then raises "Future attached to a different loop" and "another operation is in progress"

I’m running into an issue when using asyncio.run together with SQLAlchemy (async) inside a Celery task. When I call the function the first time, it works fine. On the second call, I get: RuntimeError: ...
hhhscvx's user avatar
0 votes
1 answer
40 views

How to make Open FGA Async Client work with Flask + Gunicorn?

class FGAClientWrapper: """ A synchronous, gevent-friendly wrapper for the async OpenFGA SDK. """ def __init__(self, call_timeout: float | None = 10.0): ...
vaibhav's user avatar
  • 18
2 votes
2 answers
129 views

How to safely check a multiprocessing.Event in an asyncio loop without blocking?

I'm working on an asynchronous server using asyncio, but I need to monitor a multiprocessing.Event (used to signal termination from another process) inside my async event loop. Here's the simplified ...
UnemployedBrat's user avatar
4 votes
3 answers
232 views

Pytest in FastAPI + Postgres results in: <sys>:0: RuntimeWarning: coroutine 'Connection._cancel' was never awaited

I'm writing tests for my fastapi application that uses asynchronous posgtres connection: # backend/database/session.py from sqlmodel import SQLModel from sqlmodel.ext.asyncio.session import ...
Daniel's user avatar
  • 1,025
1 vote
2 answers
62 views

coroutine was never awaited with asyncio.TaskGroup

In the following code snippet, runner takes an optional semaphore. If this semaphore is provided, then all coroutines will be wrapped to handle entering the semaphore's context manager. If I raise an ...
cjp94's user avatar
  • 63
1 vote
4 answers
90 views

Why only creating a task will run the coroutine in python?

There is something I can't understand in this code import asyncio async def fetch_data(param): print(f"Do something with {param}...") await asyncio.sleep(param) print(f"Done ...
M a m a D's user avatar
  • 2,191
2 votes
1 answer
104 views

Threading or asyncio for serial communications?

I'm running some serial commands to test connected devices under test (DUTs), & we have a need to run these in parallel/concurrently to speed up our tests. I would like some feedback on which ...
frimann's user avatar
  • 179

15 30 50 per page
1
2 3 4 5
529