Qix-/better-exceptions

python3.11 traceback raise StopIteration

Opened this issue · 0 comments

Feb 28 15:00:14 quant-api-1 wquant-cli.py[4070912]: Process Process-3:
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]: Traceback (most recent call last):
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     httplib_response = self._make_request(
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:                        ^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     six.raise_from(e, None)
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "<string>", line 3, in raise_from
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/connectionpool.py", line 462, in _make_request
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     httplib_response = conn.getresponse()
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:                        ^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/http/client.py", line 1378, in getresponse
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     response.begin()
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/http/client.py", line 318, in begin
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     version, status, reason = self._read_status()
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:                               ^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/http/client.py", line 279, in _read_status
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/socket.py", line 706, in readinto
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     return self._sock.recv_into(b)
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]: ConnectionResetError: [Errno 104] Connection reset by peer
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]: During handling of the above exception, another exception occurred:
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]: Traceback (most recent call last):
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     resp = conn.urlopen(
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/connectionpool.py", line 799, in urlopen
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     retries = retries.increment(
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:               ^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/util/retry.py", line 550, in increment
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     raise six.reraise(type(error), error, _stacktrace)
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/packages/six.py", line 769, in reraise
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     raise value.with_traceback(tb)
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     httplib_response = self._make_request(
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:                        ^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     six.raise_from(e, None)
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "<string>", line 3, in raise_from
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/urllib3/connectionpool.py", line 462, in _make_request
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     httplib_response = conn.getresponse()
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:                        ^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/http/client.py", line 1378, in getresponse
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     response.begin()
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/http/client.py", line 318, in begin
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     version, status, reason = self._read_status()
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:                               ^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/http/client.py", line 279, in _read_status
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/socket.py", line 706, in readinto
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     return self._sock.recv_into(b)
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]: urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]: During handling of the above exception, another exception occurred:
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]: Traceback (most recent call last):
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/mnt/f/quant_git/py_help/dist/py_help-1.0.2024022619-py3-none-any/py_help/cli/router.py", line -1, in real_call
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/mnt/f/quant_git/py_help/dist/py_help-1.0.2024022619-py3-none-any/py_help/api_help/api_info.py", line -1, in call_api
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/mnt/f/quant_git/wq/dist/woolen_quant-1.0.2024022619-py3-none-any/woolen_quant/cli/server.py", line -1, in server_run_web_servers
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/requests/api.py", line 73, in get
Feb 28 15:00:14 quant-api-1 wquant-cli.py[4064809]:     return request("get", url, params=params, **kwargs)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/requests/api.py", line 59, in request
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     return session.request(method=method, url=url, **kwargs)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     resp = self.send(prep, **send_kwargs)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     r = adapter.send(request, **kwargs)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/requests/adapters.py", line 501, in send
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     raise ConnectionError(err, request=request)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: During handling of the above exception, another exception occurred:
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: Traceback (most recent call last):
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/better_exceptions/formatter.py", line 314, in _format_exception
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     formatted, colored_source = self.format_traceback(exc_traceback)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/better_exceptions/formatter.py", line 277, in format_traceback
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     formatted, colored = self.format_traceback_frame(tb)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/better_exceptions/formatter.py", line 237, in format_traceback_frame
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     filename, lineno, function, source, color_source, relevant_values = self.get_traceback_information(tb)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/better_exceptions/formatter.py", line 209, in get_traceback_information
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     frame_info = inspect.getframeinfo(tb)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:                  ^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/inspect.py", line 1671, in getframeinfo
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     positions = _get_code_position_from_tb(frame)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/inspect.py", line 1653, in _get_code_position_from_tb
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     return _get_code_position(code, instruction_index)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/inspect.py", line 1660, in _get_code_position
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     return next(itertools.islice(positions_gen, instruction_index // 2, None))
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: StopIteration
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: The above exception was the direct cause of the following exception:
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: Traceback (most recent call last):
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/better_exceptions/__init__.py", line 49, in format_exception
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     return list(formatter.format_exception(exc, value, tb))
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/site-packages/better_exceptions/formatter.py", line 325, in format_exception
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     for line in self._format_exception(value, tb):
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: RuntimeError: generator raised StopIteration
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: During handling of the above exception, another exception occurred:
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: Traceback (most recent call last):
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/traceback.py", line 353, in _walk_tb_with_full_positions
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     positions = _get_code_position(tb.tb_frame.f_code, tb.tb_lasti)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/traceback.py", line 367, in _get_code_position
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     return next(itertools.islice(positions_gen, instruction_index // 2, None))
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: StopIteration
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: The above exception was the direct cause of the following exception:
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: Traceback (most recent call last):
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/bin/wquant-cli.py", line 16, in <module>
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     router.run(sys.argv[1:])
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/mnt/f/quant_git/py_help/dist/py_help-1.0.2024022619-py3-none-any/py_help/cli/router.py", line -1, in run_orig
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/mnt/f/quant_git/py_help/dist/py_help-1.0.2024022619-py3-none-any/py_help/cli/router.py", line -1, in real_call
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/traceback.py", line 187, in format_exc
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/traceback.py", line 139, in format_exception
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     te = TracebackException(type(value), value, tb, limit=limit, compact=True)
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/traceback.py", line 757, in __init__
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     context = TracebackException(
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:               ^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/traceback.py", line 702, in __init__
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     self.stack = StackSummary._extract_from_extended_frame_gen(
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:   File "/usr/local/python3.11.6/lib/python3.11/traceback.py", line 416, in _extract_from_extended_frame_gen
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]:     for f, (lineno, end_lineno, colno, end_colno) in frame_gen:
Feb 28 15:00:15 quant-api-1 wquant-cli.py[4064809]: RuntimeError: generator raised StopIteration

the python app has some cython compile .so model , dont known if it effect this