ProxyBroker icon indicating copy to clipboard operation
ProxyBroker copied to clipboard

looprun fails in while loop with OSError: [WinError 10038]

Open nisiwi opened this issue 5 years ago • 1 comments

I'm running ProxyBroker in an environment with Python 3.7 with all modules updated to current, worked previously on an older version of modules and I should have kept a copy of the stable environment (which I didn't). BTW ProxyBroker is completely failing on Python 3.8. Any idea how I resolve or is this a bug?

When running a simple while loop I'm now getting (previously worked before upgrading modules) an OSError: [WinError 10038]

Here is the code without the functions:

while len(final_proxies) < 15:
    proxies = asyncio.Queue()
    broker = Broker(proxies)
    tasks = asyncio.gather(broker.find(types=['HTTPS'], limit=no_of_proxies, countries=proxy_locations), build(proxies))
    loop = asyncio.get_event_loop()
    loop.run_until_complete(tasks)
    use_proxies = proxy_tester(new_proxies)
    use_proxies_list.extend(use_proxies)
    final_proxies = use_proxies_list
    if len(final_proxies) >= 15:
        break

Here is the error:

loop.run_until_complete(tasks)

File "C:\Users\xxx\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 571, in run_until_complete self.run_forever() File "C:\Users\xxx\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 539, in run_forever self._run_once() File "C:\Users\xxx\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 1739, in _run_once event_list = self._selector.select(timeout) File "C:\Users\xxx\AppData\Local\Programs\Python\Python37-32\lib\selectors.py", line 323, in select r, w, _ = self._select(self._readers, self._writers, [], timeout) File "C:\Users\xxx\AppData\Local\Programs\Python\Python37-32\lib\selectors.py", line 314, in _select r, w, x = select.select(r, w, w, timeout) OSError: [WinError 10038] An operation was attempted on something that is not a socket

nisiwi avatar Dec 16 '19 19:12 nisiwi

Traceback (most recent call last):
  File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\Scripts\proxybroker.exe\__main__.py", line 9, in <module>
  File "c:\program files\python37\lib\site-packages\proxybroker\cli.py", line 433, in cli
    loop.run_until_complete(asyncio.gather(*tasks, loop=loop))
  File "c:\program files\python37\lib\asyncio\base_events.py", line 574, in run_until_complete
    self.run_forever()
  File "c:\program files\python37\lib\asyncio\base_events.py", line 541, in run_forever
    self._run_once()
  File "c:\program files\python37\lib\asyncio\base_events.py", line 1750, in _run_once
    event_list = self._selector.select(timeout)
  File "c:\program files\python37\lib\selectors.py", line 323, in select
    r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "c:\program files\python37\lib\selectors.py", line 314, in _select
    r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] 在一个非套接字上尝试了一个操作。

gMan1990 avatar May 18 '20 09:05 gMan1990