1,720 questions
0
votes
0
answers
15
views
python server / JS client: socketio regular disconnects
In trying to reproduce errors from a larger project I have created a server using python's aiohttp and the following python-socketio (v5.12.0) namespace:
class MyNamespace(AsyncNamespace):
...
0
votes
2
answers
54
views
How to make dynamic path that will be represented as list in aiohttp server?
Let's say that I have an example code:
from aiohttp import web
async def example(r):
a = r.match_info.get('a')
b = r.match_info.get('b')
c = r.match_info.get('c')
return web.Response(...
0
votes
0
answers
60
views
Bria API Slow Response Time (~40-60s per Image) When Processing 300+ Images Asynchronously in Python https://bria.ai/
I’m currently integrating the Bria API to remove backgrounds from video frames (images) in bulk using asynchronous Python code.
The setup works fine for a small number of images, but when I send more ...
0
votes
0
answers
66
views
Why torify+aiohttp gives out error "Cannot connect to host python.org:80 ssl:default [Could not contact DNS servers]"?
Linux Mint, python 3.12
NB: torify works well with curl.
So I activate venv, then run Tor, then drun the snippet.
The code:
import aiohttp
import asyncio
async def main():
async with aiohttp....
1
vote
1
answer
78
views
How to "swallow" python's asyncio library's TimeoutError exception
I have a python script that connects to a server and downloads a large amount of videos and photos. And when I say large, I mean in the tens of thousands. The total amount of data to be downloaded ...
0
votes
1
answer
56
views
Cannot reference aiohttp classes in my documentation
I am working on a project that uses aiohttp. I'm setting up my documentation using sphinx on ReadTheDocs.org.
I have set up the interpshinx extension in conf.py and configured the mapping as following:...
0
votes
0
answers
72
views
Please tell me how to disable SSL for aiohttpSession?
I'm writing a small python 3.12 bot using aiogram3 and asyncio.
The bot will be running at work, on one of the servers. There is a security policy that allows access to the external Internet only ...
0
votes
2
answers
56
views
My asynchronous program freezes when trying to read the html of the response
I recently started learning asyncio in python and faced a problem when I was practicing Queues. My task was to write a code that gets random pics from site, parses img links and downloads those images ...
1
vote
1
answer
57
views
Using a dict for caching async function result does not use cached results
BASE_URL = "https://query2.finance.yahoo.com/"
DATA_URL_PART = "v8/finance/chart/{ticker}"
async def fetch_close_price(aiosession: aiohttp.ClientSession,
...
0
votes
0
answers
37
views
async posting just hangs
I'm using aiohttp to post multiple times, but I find an issue that means that I never get beyond the first post. Code then hangs for a while and produces the below error.
async def posted(URL, payload)...
0
votes
0
answers
32
views
aiohttp post request h11._util.LocalProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_BODY [duplicate]
I'm using aiohttp==3.10.10 with python 3.8
For context I'm running a fastAPI app and on every request the app receives it creates an async background task to send a post request to another external ...
0
votes
0
answers
46
views
aiohttp showing 403 error but requests.get giving 200 response
I'm using aiohttp to asynchronously retrieve a price from a url. Previously, I used requests.get for synchronous reading. I can successfully fetch the data with requests.get, but the same url gives a ...
1
vote
0
answers
133
views
RuntimeError: "Timeout context manager should be used inside a task" with pytest-asyncio but works in direct Python execution
Using asyncio and aiohttp in an application I'm building and can't seem to figure out how to get pytest playing nicely. When I use pytest I always get a
RuntimeError: Timeout context manager should ...
0
votes
1
answer
517
views
SSL and aiohttp: disable SSL verification do not work on python 3.12
I have a request like this from aiohttp:
async with aiohttp.ClientSession(auth=aiohttp.BasicAuth(self.user, self.password), timeout=aiohttp.ClientTimeout(connect=self.timeouts[0], sock_read=self....
0
votes
1
answer
43
views
wait_for asyncio event prevents aiohttp from proper cleanup
I found unintuitive behaviour of asincio.wait_for when waiting for asyncio.Event. Aiohttp cleanup is not working in this case:
import asyncio
import logging
from aiohttp import web
async def ctx(app):...