Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting an error in partition command #29

Open
ezequias opened this issue May 9, 2019 · 2 comments
Open

I am getting an error in partition command #29

ezequias opened this issue May 9, 2019 · 2 comments

Comments

@ezequias
Copy link

ezequias commented May 9, 2019

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
Copy link
Owner

nmoya commented May 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ezequias @nmoya and others