Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixes #210 and some refactoring #214
Fixes Bug #210 by not crashing, and spits out a message "Not a utf-8 string"
Took the liberty to generally refactor
Edit: Would also like to mention that this should improve performance slightly since it'll only do a lookup in the dict once instead of twice.
I also changed handleMessages to use a dict instead of a series of if/elif/else. It takes a more EAFP approach and makes it a little easier to read in my opinion. Let me know if you like or dislike the change.
Tested it working in a Python 3.6 environment (server + 2 clients)
I would need to do extensive testing before allowing a refactor because the last time I allowed one it broke things in subtle ways that were hard to detect and track down. I do not currently have time for this at present so I will leave this PR open for now.