maxzheng / aiohttp-requests Goto Github PK
View Code? Open in Web Editor NEWA thin wrapper for aiohttp client with Requests simplicity
License: MIT License
A thin wrapper for aiohttp client with Requests simplicity
License: MIT License
See this line:
Patching the 'ClientResponse.read' will break other libraries that depend on its behavior. My project was also using aioboto3, which led to ClientDisconnect errors.
Similar to the preceding issue #6, this library breaks aiodocker
.
More details here: aio-libs/aiodocker#706
This is caused by: PyYoshi/cChardet#81
In Python 3.11 I ran tox:
× Running setup.py install for cchardet did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
running install
C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
Traceback (most recent call last):
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\util.py", line 212, in subst_vars
return subst_compat(s).format_map(lookup)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'homedir'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\KleinKonstantin\AppData\Local\Temp\pip-install-ys1zs43a\cchardet_cc1deee867f8447c8b0dde3dbb638242\setup.py", line 115, in
setup(
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_init.py", line 108, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools\dist.py", line 1221, in run_command
super().run_command(command)
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\dist.py", line 987, in run_command
cmd_obj.ensure_finalized()
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools\command\install.py", line 45, in finalize_options
orig.install.finalize_options(self)
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\command\install.py", line 439, in finalize_options
self.expand_basedirs()
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\command\install.py", line 619, in expand_basedirs
self._expand_attrs(['install_base', 'install_platbase', 'root'])
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\command\install.py", line 613, in _expand_attrs
val = subst_vars(val, self.config_vars)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\github\aiohttp-requests{homedir}.virtualenvs\aiohttp-requests\Lib\site-packages\setuptools_distutils\util.py", line 214, in subst_vars
raise ValueError(f"invalid variable {var}")
ValueError: invalid variable 'homedir'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> cchardet
Hi!
Cool library, really reduces the headache moving from requests
to aiohttp
. I can see that this supports all of the HTTP verbs, but I'm curious if it'd be possible to support request(method, url, ...)
too. As far as I can tell, this isn't supported despite it being supported in aiohttp
?
Thank you!
I get this warnings :
\env36\lib\site-packages\aiohttp_requests\__init__.py:25: DeprecationWarning: client.loop property is deprecated
if not self._session or self._session.closed or self._session.loop.is_closed():
with
aiohttp==3.5.1
aiohttp-requests==0.1.2
asyncio==3.4.3
request==2018.11.20
hello when i install aiohttp_requests throw to this question:
clang: error: no such file or directory: 'export'
clang: error: no such file or directory: 'CPPFLAGS=-I/usr/local/opt/readline/include'
error: command 'g++' failed with exit status 1
----------------------------------------
Command "/Users/xiaxichen/.workspace/env_python3.7/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/qk/tgc9vq6j6lbgwlsxgb4lyyd40000gn/T/pip-install-glkxfe9_/cchardet/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/qk/tgc9vq6j6lbgwlsxgb4lyyd40000gn/T/pip-record-pben7gfy/install-record.txt --single-version-externally-managed --compile --install-headers /Users/xiaxichen/.workspace/env_python3.7/bin/../include/site/python3.7/cchardet" failed with error code 1 in /private/var/folders/qk/tgc9vq6j6lbgwlsxgb4lyyd40000gn/T/pip-install-glkxfe9_/cchardet/
You are using pip version 19.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Hello, I am wondering why you need to await for response.text()? Thought the request.get() is the only thing that needs awaited?
I'd like to pass an argument to the ClientSession to disable the SSL verification (for a testsystem with selfsigned cert), like described here
session = aiohhtp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False))
Is there a possibility to pass arguments to the ClientSession with aiohttp-requests?
Edit: In case anyone needs this urgently you can modify the "private" variable that stores the session arguments:
from aiohttp_requests import requests
...
requests._session_args[1]["connector"] = aiohttp.TCPConnector(verify_ssl=False)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.