Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 31 2019 19:45
    dcecile commented #503
  • Jan 31 2019 19:40
    blueyed commented #526
  • Jan 31 2019 13:29
    codecov[bot] commented #526
  • Jan 31 2019 13:26
    codecov[bot] commented #526
  • Jan 31 2019 11:59
    codecov[bot] commented #526
  • Jan 31 2019 11:59
    popravich synchronize #526
  • Jan 31 2019 11:59

    popravich on travis_pypy

    .travis.yml: chaching pip packa… Makefile: build/install only re… .travis.yml: cache redis-server… (compare)

  • Jan 31 2019 11:44
    codecov[bot] commented #526
  • Jan 31 2019 11:36
    codecov[bot] commented #526
  • Jan 31 2019 11:35
    codecov[bot] commented #526
  • Jan 31 2019 11:34
    codecov[bot] commented #526
  • Jan 31 2019 11:24
    codecov[bot] commented #526
  • Jan 31 2019 11:23
    codecov[bot] commented #526
  • Jan 31 2019 10:04
    gyermolenko commented #503
  • Jan 31 2019 09:31
    gyermolenko commented #431
  • Jan 31 2019 09:23
    Natim closed #444
  • Jan 31 2019 09:23
    Natim commented #444
  • Jan 31 2019 09:09
    gyermolenko commented #444
  • Jan 31 2019 05:32
    codecov[bot] commented #539
  • Jan 31 2019 05:32
    vir-mir synchronize #539
nicolalandro
@nicolalandro
(I'm speaking about aiokafka on python)
Mahas1
@Mahas1
wanted to drop in here to say that I have successfully managed to install Aiohttp on an iPad air. A person here had helped me quite a bit here.
Here's what I did:
  • logged in as root using su root
  • installed a c/c++ compiler from Cydia
  • installed python3.7 using apt
  • installed pip using python3 -m ensurepip
  • installed build-essential using Filza
  • extracted iPhoneOS.sdk from Xcode and placed it in /usr/share/SDKs
  • installed LLVM+Clang from Cydia
  • installed ld64, also from Cydia
  • the person who was helping me here suggested I do EXPORT AIOHTTP_NO_EXTENSIONS (I don't remember this command accurately). I didn't have to do this once I got everything above installed
  • finally installed aiohttp using pip3 install aiohttp
3 replies
image.png
Here's the neofetch, with the model number
it's an iPad4,1
devbrian
@devbrian
Hey, have a quick question.. does aiohttp have any similar feature to the request library HTTPAdapter? Migrating my application over to being async, and trying to find a way to implement a HTTPAdapter that's required for my application.. (use case is I need to spoof TLS handshake and this HTTPAdapter does that)
2 replies
part1cleth1ef
@part1cleth1ef
Hey there, is it possible to override the body of a request in a middleware with aiohttp server?
Andrew Svetlov
@asvetlov
It depends. Streaming response cannot override the body (I can imagine the required API but it is not designed/implemented yet). If isinstance(resp, web.Response)check pass you can replace resp.body
13 replies
mrnaif
@mrnaif:matrix.org
[m]
Hello! I have a question, but I'm not fully sure if it's related to aiohttp or to my code. In my pytest tests aiohttp's request sending code hangs.
I re-checked the common issues, aiohttp session was created with the same event loop as the one which sends the requests, same event loop policy, etc
It basically hangs at asyncio.shield (aiohttp 3.8.1, connector.py, around line 1148, hosts = await asyncio.shield(asyncio.ensure_future(self._resolve_host(....
And it all works fine (tests are sync but manage event loop the correct way), but when before those tests one async test is run by pytest-asyncio, it does some changes which makes it hang. Tried everything possible but still not sure what it is. How could it hang if it runs on the correct loop? Something is blocking the event loop? There's no time.sleep or something like that (there is in main process, but the test runs in a subprocess started with multiprocessing), it runs starts async function via run_until_complete, the function and coroutines it awaits execute successfully in aiohttp code too, till it gets to that connection process
12 replies

More exactly what I try to implement, is to add tests for different models of execution of my library, based off those test cases (when run manually one by one it works, when run in pytest it works too, but if async test was run before it gets stuck or other exceptions):
https://gist.github.com/rking32/818bd60a6dd1e632ac61ba6f7e902a5a

Here's my code (it's quite complex because this is like the 10th iteration trying to make it work without hanging). I tried executing test cases manually and confirmed that tests should pass, it's something from pytest-asyncio, but not sure what exactly.
https://www.toptal.com/developers/hastebin/gipexujexe.py

(event loop policy's and event loop's ids at async test and test that hang match, so it should be same event loop)

3 replies
Sorry if that's the wrong place to ask, but I don't know any asyncio experts and it's hanging at aiohttp part, though probably not aiohttp issue by itself (:
mrnaif
@mrnaif:matrix.org
[m]
Well I do exactly that: https://github.com/bitcartcc/bitcart-sdk/blob/master/bitcart/utils.py#L90-L112. On main thread event loop is assigned to automatically too. And everything works when there is no pytest-asyncio involved, which is weird.
mrnaif
@mrnaif:matrix.org
[m]
It does exactly that, it starts the coroutine via run_coroutine_threadsafe: https://github.com/bitcartcc/bitcart-sdk/blob/master/bitcart/sync.py#L29-L38. And when coroutine is started await calls inside work just fine till it gets to the moment with await asyncio.shield(asyncio.ensure_future(self._resolve_host(... in aiohttp code
When no other tests involving async were run it is fine, but if some test with pytest-asyncio was run before that, it fails, not sure why
mrnaif
@mrnaif:matrix.org
[m]
That's not my code, this file is a standalone file with reproduction test cases where they can run one by one. My code in tests is here: https://www.toptal.com/developers/hastebin/gipexujexe.py
What I try to do is to adapt test cases so they can be run via pytest and not manually one by one and all automatically
mrnaif
@mrnaif:matrix.org
[m]
Wait, to communicate what? That a method was called? I use a subprocess exactly to not modify main process state and to be able to not block the whole execution (otherwise I would be testing for example not async in threads, but async in threads in threads, or something like that)
3 replies
Joongi Kim
@achimnol
https://github.com/syrusakbary/aiodataloader This project is a crucial component for many GraphQL-based projects, but it seems to be abandoned by the author. Since it is MIT license, how about forking and migrating it into aio-libs?
1 reply
David Meushar
@DavidMeu
Hi all,
Having this weird error trying to call a remote host:
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host HOST:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1125)')]

Thing is this is working on my collegue PC.

+
curl and requests working fine.

neildesai
@neildesai
I've added asyncio and aiohttp to increase the speed at which my tool makes API calls. It's working very well when I run it on Jupyter but when I set up a crontab locally on my Macbook, it seems to not work when I import aiohttp. I have double checked my environment and the module is installed. Does anyone else have this issue? Do you know any workarounds?
3 replies
Yuval
@yuvalherziger
Hoping this is the right place to share this: sharing an aiohttp middleware-based library I recently published: aiohttp-catcher. Feel free to give it a test drive and share your thoughts. I also put together a short blog post about it for those interested.
6 replies
Anurudh Mhatre
@raavann

Hello.. hope you're all doing great..
I'm kind of new to async stuff,.. and i'm trying to pull option-chain data for 200 stocks..
Here's the code i wrote..
http://pastie.org/p/1hkmkGTnYdilUrl1PNvmZl

Well it works, for 40 stocks at a time, i guess the problem is the website blocks too many api calls at a time.. and sends 401Unauthorized error..
Any help to get around this would be very much appreciated,
Thannk YOU.. :D

1 reply
ashish-gupta1-by
@ashish-gupta1-by
I am using aiokafka. I am getting below error. Anyone has any clue for the fix
getting error Heartbeat failed: local member_id was not recognized; resetting and re-joining group
alq
@alllq:matrix.org
[m]

Hello please help.
aiohttp.client.request allow method in args (method like "POST","PUT".

HOW make it in CientSession() as session:

session(method

Alex Grönholm
@agronholm
@alllq:matrix.org you mean like session.post() etc?
2 replies
or session.request()?
alq
@alllq:matrix.org
[m]
thanks, it looks like it's working
ForgottenKnight
@ForgottenKnight
Hello, does anyone have any experience connecting a websocket-sharp to a aiohttp server websocket? I'm having issues since the client websocket requires me to connect to a ws:// scheme but the aiohttp server uses a http:// scheme.
4 replies
stuoningur
@stuoningur
Hey, I try to scrape a website but I don't get a reply and eventually run into the timeout. I had the same issue with requests, but adding a custom user agent was enough, this doesn't seem to work with aiohttp though, I still get no reply
stuoningur
@stuoningur
nevermind, i had to add connection keep alive to the header manually
Nazar
@NazarKostetskiy
Hi. Does anyone have an example of Redis lock usage in aioredis 2.0?
kmodexc
@kmodexc:matrix.org
[m]
https://pypi.org/simple/aiohttp/ tells me there is a version 4.0.0 but github has only 3.8.1. Im asking, because my package depends on this and it fails on building.
Alex Grönholm
@agronholm
@kmodexc:matrix.org there is no 4.0.0 final
they're alpha releases (4.0.0a1 and 4.0.0a2) – pre-releases don't show up normally, you have to go looking for them
2 replies
dunderstr aka seimen
@cloasdata
can i use janus q instead of a mp.manager.queue?
dunderstr aka seimen
@cloasdata

can i use janus q instead of a mp.manager.queue?

No because pickle wont eat it...

beefsalad
@beefsalad
client example on the website throws indention errors for me on several systems :(
Alex Grönholm
@agronholm
what example
Alex Grönholm
@agronholm
@beefsalad looks fine to me – are you sure you're not pasting it wrong?
what specific error are you getting?
beefsalad
@beefsalad

beefsalad@derp:/data$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import aiohttp
import asyncio

async def main():
File "<stdin>", line 1
async def main():
^
IndentationError: unexpected indent
async def main():
... async with aiohttp.ClientSession() as session:
... async with session.get('http://python.org') as response:
...
File "<stdin>", line 4

not sure how one could paste it wrong, but I've pasted it into vscode and everything appears to line up as I would expect it to be
interesting...if I paste into a file and call python3 file.py it works fine?
Stuart Longland
@sjlongland
You're probably better off not trying to paste complex code (especially async code) into an interactive shell.
Chey
@chey
does aiohttp have a badge?
4 replies
...something like a "powerd by: aiohttp" badge that i can display on my own projects
Devin Smith
@devinrsmith
Hi - I'm curious about the computational complexity of compression wrt batches. Does each additional append cause the full batch to need to be re-compressed?
(For aiokafka producer manual batch control)
bolnav
@bolnav:matrix.org
[m]
Networking-newbie question: I need to connect to a server that has a self-signed certificate. The documentation for Advanced client usage says to ssl.create_default_context(cafile='...'), which I expected, AND to do ssl.SSLContext.load_cert_chain() on the private key, which I cannot do, because the key is on the server. Am I reading it wrong?
Santiago Andres Rodriguez Gonzalez
@ratovarius
Hello, I'm using aiohttp to analize some cases in redirection chain for some urls. Is it possible to get the final url (or the redirection chain) when there is a timeout?