简体   繁体   中英

mitmdump error: too many file descriptors in select() issue in windows

I try to capture requests on Android applications using mitmdump and python script, but mitmdump seems to be easily blocked and throws the following error:

Traceback (most recent call last):
  File "D:\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\Python\Python39\Scripts\mitmdump.exe\__main__.py", line 7, in <module>
  File "D:\Python\Python39\lib\site-packages\mitmproxy\tools\main.py", line 147, in mitmdump
    m = run(dump.DumpMaster, cmdline.mitmdump, args, extra)
  File "D:\Python\Python39\lib\site-packages\mitmproxy\tools\main.py", line 114, in run
    master.run()
  File "D:\Python\Python39\lib\site-packages\mitmproxy\master.py", line 81, in run
    self.run_loop(loop.run_forever)
  File "D:\Python\Python39\lib\site-packages\mitmproxy\master.py", line 64, in run_loop
    self.shutdown()
  File "D:\Python\Python39\lib\site-packages\mitmproxy\master.py", line 100, in shutdown
    self.event_loop.run_until_complete(asyncio.wrap_future(ret))
  File "D:\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete
    self.run_forever()
  File "D:\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever
    self._run_once()
  File "D:\Python\Python39\lib\asyncio\base_events.py", line 1854, in _run_once
    event_list = self._selector.select(timeout)
  File "D:\Python\Python39\lib\selectors.py", line 324, in select
    r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "D:\Python\Python39\lib\selectors.py", line 315, in _select
    r, w, x = select.select(r, w, w, timeout)
ValueError: too many file descriptors in select()

The mitmdump server is running in windows. It seems to limit the concurrency of mitmdump, but I don't know how to modify the source code.Could anyone share some idea for it?

The latest development releases (what will eventually be 8.0) use the ProactorEventLoop on Windows, which fixes this issue.

For now you can either have fewer concurrent connections, or upgrade to the development snapshots.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM