nmoya / whatsapp-parser

Parser to the What's App log file.
MIT License
47 stars 23 forks source link

I am getting an error in partition command #29

Open ezequias opened 5 years ago

ezequias commented 5 years ago

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'

nmoya commented 5 years ago

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.