chat-miner icon indicating copy to clipboard operation
chat-miner copied to clipboard

Index out of range while parsing

Open mochiron-desu opened this issue 2 years ago • 1 comments

I was trying this app when I encountered this problem that while parsing the text file it's showing this error.

PS D:\Coding\Python> & C:/Users/qwerk/AppData/Local/Programs/Python/Python37/python.exe d:/Coding/Python/chat-miner/run.py
INFO:chatminer.chatparsers.WhatsAppParser.2067091229440:Finished reading 40001 messages.
INFO:chatminer.chatparsers.WhatsAppParser.2067091229440:Inferred month first format.
Traceback (most recent call last):
  File "d:/Coding/Python/chat-miner/run.py", line 5, in <module>
    parser.parse_file_into_df()
  File "d:\Coding\Python\chat-miner\chatminer\chatparsers.py", line 29, in parse_file_into_df
    self._parse_message(mess)
  File "d:\Coding\Python\chat-miner\chatminer\chatparsers.py", line 98, in _parse_message
    body = mess.split('-', 1)[1]
IndexError: list index out of range

Is it because of the long chats? (maybe?)

mochiron-desu avatar Jun 29 '22 14:06 mochiron-desu

The length of the chat should not play a role. The issue is likely caused by a message format we haven't seen yet. WhatsApp formats your logfile differently according to your localization and maybe app version/OS as well. I introduced a debugging logic in 1d71c1f. Please check the problematic messages, which will be exposed in the logger warning.

joweich avatar Jun 29 '22 19:06 joweich