Skip to main content

All Questions

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, ...
SAK's user avatar
  • 148
0 votes
2 answers
152 views

Timeout Issue with aiohttp but not with Requests

I'm trying to fetch a webpage in Python using two different methods: requests and aiohttp. The requests method works fine, but the aiohttp method results in a timeout. Here's the code: import asyncio ...
graille's user avatar
  • 1,241
0 votes
2 answers
125 views

How do I fix session closed error when using asyncio library

I'm trying write a python script that makes a bunch of parallel http requests. Here is what I have so far. async def deleteLinkRecords(req_headers): async with aiohttp.ClientSession(trust_env=True) ...
RKodakandla's user avatar
  • 3,502
0 votes
0 answers
132 views

await asyncio.open_connection(ip, port) stalls until "[WinError 121] The semaphore timeout period has expired" occurs

I am trying to learn about asynchronous bittorrent protocol from this repo. However, when I try to run the program. (With a custom torrent I uploaded, which works on software like qbittorrent). The ...
Elton MDX's user avatar
0 votes
0 answers
320 views

aiohttp starts throwing WinError 64 suddenly

My program has stopped working and throwing WinError 64 after downloading > 800,000 files in different batches. The requested urls are active, so the network location is still live. To debug, I ran ...
Sudipto Ray's user avatar
0 votes
1 answer
593 views

Aiohttp and Asyncio give an error when writing a bot on aiogram

I'm writing a bot on Aiogram. I did everything according to the documentation, but I get an error. I'm seeing her for the first time. Please help me solve the problem def on_startup(bot: Bot) -> ...
fk3ddx's user avatar
  • 1
1 vote
1 answer
53 views

How to create await-able object in python with specific methods

There is aiohttp based server that looks like: import aiohttp routes = web.RouteTableDef() @routes.post('/route1') async def route1(request): req_json = await request.json() step1 = func1(...
tima's user avatar
  • 73
0 votes
0 answers
259 views

How to properly terminate or close a background task in aiohttp application?

I'm writing an app using aiohttp and asyncio. One of the parts of the app is supposed to continuously monitor a specific device for incoming data. It works as expected except that I cannot close the ...
miwa's user avatar
  • 437
2 votes
0 answers
365 views

"Session is closed" error even after making a new aiohttp.ClientSession

Description of intent: What I'm trying to do is use asyncio and aiohttp to retrieve the data off some websites fast. Sometimes, the website sends 50* errors and I'm trying to brute force the 200 ...
Lazar Jovanovic's user avatar
2 votes
1 answer
445 views

Forwarding a request to another API in Python (Rust) Robyn

I am using FastAPI to take in a JSON file which will then be the body of an API request out.. Orwell and Good so far. Now I want to apply the same but with robyn built on rust, instead of FastAPI. Not ...
codervince's user avatar
2 votes
1 answer
846 views

Specify SNI server_hostname when performing request with asyncio/aiohttp

Hello fellow developers ! I'm stuck in a corner case and I'm starting to be out of hairs to pull... Here is the plot : load-balancer.example.com:443 (TCP passthrough) ...
AsyncBrain's user avatar
0 votes
1 answer
177 views

Why does my second python async (scraping) function (which uses results from the first async (scraping) function) return no result?

Summary of what the program should do: Step 1 (sync): Determine exactly how many pages need to be scraped. Step 2 (sync): create the links to the pages to be scraped in a for-loop. Step 3 (async): Use ...
afrobdeluxe's user avatar
0 votes
1 answer
903 views

AIOHTTP RetryClient on JSON Decode Errors

I am trying to use the aiohttp_retry's RetryClient to address random JSON decoding errors, but it seems retries are not working. Can JSON decode errors be retried? ERROR - message='Attempt to decode ...
TASC Solutions's user avatar
0 votes
0 answers
291 views

Why is this website loading in the browser but gives a 503 error in aiohttp

I am trying to load an RSS feed via aiohttp from datetime import datetime from urllib.parse import urlparse import asyncio import aiohttp import os request_headers = { "User-Agent": &...
PirateApp's user avatar
  • 6,278
1 vote
1 answer
386 views

How to make multiple REST calls asynchronous in python3

I have the following code to make multiple REST calls. Basically I have a dictionary where key is a string and value is a JSON date that I need to use as payload to pass to a REST API POST method. At ...
azaveri7's user avatar
  • 939

15 30 50 per page
1
2 3 4 5
19