Closed marselester closed 1 month ago
Hi @marselester, thanks for opening this issue.
There is something going on with aiohttp
I still don't fully understand, but I am aware of it.
So far my investigation brought me to see very strong similarities with https://github.com/aio-libs/aiohttp/issues/5582.
The latest version of Mocket was a big refactoring, mostly meant to fix https://github.com/mindflayer/python-mocket/pull/234/, and I strongly believe there is nothing wrong with Mocket itself, but of course I am open to help with this.
I see from your CI that the same code works for the most recent versions of Python, which coincides with my findings.
Thank you for looking into this issue ❤️
Hey @marselester, if you manage to write a few lines able to replicate the issue I'll be more than happy to help with that, even if I suspect it's not related to Mocket itself.
Maybe this would help. I know it doesn't narrow down the problem greatly, but it could be a starting point.
$ pyenv local 3.10.13
$ virtualenv venv
$ . venv/bin/activate
(venv) $ pip install -e git+https://github.com/maxmind/GeoIP2-python.git@559f145915c811c2ea93201195ad2139debce760#egg=geoip2
(venv) $ pip install mocket==3.12.7
(venv) $ pip freeze
aiohttp==3.9.5
aiosignal==1.3.1
async-timeout==4.0.3
attrs==23.2.0
certifi==2024.2.2
charset-normalizer==3.3.2
decorator==5.1.1
frozenlist==1.4.1
-e git+https://github.com/maxmind/GeoIP2-python.git@559f145915c811c2ea93201195ad2139debce760#egg=geoip2
httptools==0.6.1
idna==3.7
maxminddb==2.6.1
mocket==3.12.7
multidict==6.0.5
python-magic==0.4.27
requests==2.32.3
urllib3==2.2.1
yarl==1.9.4
(venv) $ python mytest.py
I took an example from your README and it also failed with asyncio.exceptions.TimeoutError
.
(venv) $ python t.py
The strange thing is that it works well with Python 3.11+.
OK, there was indeed something strange when using aiohttp
with HTTPS urls. Weird that I did not see it happening with Python 3.11+, but still a problem to fix.
Here is a version which fixes it: https://pypi.org/project/mocket/3.12.8/
Awesome, thanks a lot!
Hi Giorgio. Thank you for your work on this library!
It looks like there was a breaking change in https://github.com/mindflayer/python-mocket/compare/3.12.6...3.12.7: