romis2012 / python-socks

Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python
Apache License 2.0
101 stars 18 forks source link

'Maximum recursion depth exceeded' if eventlet is installed #20

Closed csaftoiu closed 1 year ago

csaftoiu commented 1 year ago

If eventlet is installed then socket.connect(...) causes a "Maximum recursion depth exceeded" exception:

Traceback (most recent call last):
  File "/Users/csaftoiu/work/git/my-project/runner.py", line 115, in step_foobit
    self.magic_store.connect()
  File "/Users/csaftoiu/work/git/my-project/my_project/womg/magic_store.py", line 291, in connect
    self.conn.foobit(
  File "/Users/csaftoiu/work/git/my-project/my_project/womg/connection.py", line 715, in foobit
    self.__create_connection(pre_foobit_data['conn_info'])
  File "/Users/csaftoiu/work/git/my-project/my_project/womg/connection.py", line 501, in __create_connection
    sock.connect(server_address)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 47, in wrapper
    return function(*args, **kwargs)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 774, in connect
    super(socksocket, self).settimeout(self._timeout)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/eventlet/greenio/base.py", line 422, in settimeout
    self.setblocking(True)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 296, in setblocking
    self.settimeout(None)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 287, in settimeout
    super(socksocket, self).settimeout(self._timeout)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/eventlet/greenio/base.py", line 422, in settimeout
    self.setblocking(True)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 296, in setblocking
    self.settimeout(None)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 287, in settimeout
    super(socksocket, self).settimeout(self._timeout)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/eventlet/greenio/base.py", line 422, in settimeout
    self.setblocking(True)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 296, in setblocking
    self.settimeout(None)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 287, in settimeout
    super(socksocket, self).settimeout(self._timeout)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/eventlet/greenio/base.py", line 422, in settimeout
    self.setblocking(True)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 296, in setblocking
    self.settimeout(None)
  ...
    File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/eventlet/greenio/base.py", line 422, in settimeout
    self.setblocking(True)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 296, in setblocking
    self.settimeout(None)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 287, in settimeout
    super(socksocket, self).settimeout(self._timeout)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/eventlet/greenio/base.py", line 422, in settimeout
    self.setblocking(True)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 296, in setblocking
    self.settimeout(None)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 287, in settimeout
    super(socksocket, self).settimeout(self._timeout)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/eventlet/greenio/base.py", line 422, in settimeout
    self.setblocking(True)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 296, in setblocking
    self.settimeout(None)
  File "/Users/csaftoiu/work/git/my-project/env/projenv/lib/python3.10/site-packages/socks.py", line 286, in settimeout
    peer = self.get_proxy_peername()
RecursionError: maximum recursion depth exceeded

If eventlet is not installed then there's no issue.

This is with python-socks==2.1.1 and eventlet==0.33.2

romis2012 commented 1 year ago

https://github.com/Anorov/PySocks

romis2012 commented 1 year ago

You got the wrong address