-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue on running the README quickstart script with python 3.8 interpreter #109
Comments
@afunTW @vincentinttsh @hms5232 @ziloka able to help on this? 😅 |
This happened in Python 3.9 too.
I use poetry run a virtual env and here is
run
I'm not sure that is a bug or something I miss. Somebody can help? |
This seems to work """Find and show 10 working HTTP(S) proxies."""
import asyncio
from proxybroker import Broker
async def show(proxies):
while True:
proxy = await proxies.get()
if proxy is None:
break
print('Found proxy: %s' % proxy)
proxies = asyncio.Queue()
loop = asyncio.get_event_loop_policy().get_event_loop()
broker = Broker(proxies, loop=loop)
tasks = asyncio.gather(broker.find(types=['HTTP', 'HTTPS'], limit=10), show(proxies))
loop.run_until_complete(tasks) |
the reason is because you need to pass the loop into the Broker constructor. On python 3.10 it seems like theres a deprecation warning that I did not think of previously |
now that i think about it, i unintentionally broke the examples |
so the example actually works, i just need a change to be made to fix the thing I didn't know i broke |
Related #110 Merge this and the basic example should work without any changes EDIT: tested on 3.8, and 3.10 |
Merged 👍 |
AttributeError: 'TransportSocket' object has no attribute 'close' |
I tried the quickstart snippet on the readme:
To Reproduce
Steps to reproduce the behavior:
pip install -U git+https://github.com/bluet/proxybroker2.git .
run the snippet as described in the readme and stated above .
Expected behavior
Showing proxies in the console.
Desktop (please complete the following information):
Additional context
I also tried the below by creating a new loop and assigning it to the Broker constructor.
Which gave me this traceback:
I've read that it doesn't support python version 3.10 here : here but I think it should be supporting 3.9/3.8 ? Read it from this commit .
Also I've tried running the same script on a FastAPI instance and it works just fine on 3.8 (not tested yet in 3.9, if needed I can update you on this).
The text was updated successfully, but these errors were encountered: