whatsapp-parser icon indicating copy to clipboard operation
whatsapp-parser copied to clipboard

I am getting an error in partition command

Open ezequias opened this issue 6 years ago • 2 comments

Hi

I am getting the following message in the partition line of whatsapp.py file:

Traceback (most recent call last): File "chat.py", line 239, in main() File "chat.py", line 227, in main c.parse_messages() File "chat.py", line 71, in parse_messages self.senders, self.messages = p.parse() File "C:\projetos\whatsapp-parser\parsers\whatsapp.py", line 19, in parse msg_date, msg = l.partition(": ") TypeError: a bytes-like object is required, not 'str'

ezequias avatar May 09 '19 12:05 ezequias

Hm, that is weird. It's a TypeError, so this means that whatever is in your variable l is incorrect. l should be a string, so it can be partitioned (split) by : . https://www.programiz.com/python-programming/methods/string/partition

I recommend you to put some prints in l to check content and type. Also, double check if your chat history has the correct format.

nmoya avatar May 09 '19 13:05 nmoya