python3 server.py Exception in thread Thread-2: Traceback (most recent call last): File…
- User
python3 server.py
Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run 2025-06-26 16:01:14,841 - vb - INFO - k_STTServer сервер запущен на 0.0.0.0:5000 self._target(*self._args, **self._kwargs) File "/home/user/voice_bot/bot/k_server_main.py", line 78, in stt from bot.k_server_stt_vosk import _stt File "/home/user/voice_bot/bot/k_server_stt_vosk.py", line 84 logger.warning(f"2-33 _stt: all_tokens: {all_tokens}")
all_tokens = list() all_tokens.append(list(zip(tokens, timestamps))
logger.warning(f"2-33 _stt: all_tokens: {all_tokens}") - Assistant
The main issue in your traceback and code snippet is a syntax error, related to mismatched parentheses.
In the snippet you posted:
all_tokens = list() all_tokens.append(list(zip(tokens, timestamps)) logger.warning(f"2-33 _stt: all_tokens: {all_tokens}")The
appendline:all_tokens.append(list(zip(tokens, timestamps))has an opening parenthesis for
append(and forlist(but only one closing parenthesis. It should have two closing parentheses because:- One closes
list(zip(tokens, timestamps)) - The other closes the
append(...)call
So, the correct line would be:
all_tokens.append(list(zip(tokens, timestamps)))
How to fix your code:
Change this:
- One closes