In the original script it would crash also in manager.PrivateChat(sys.argv[1], timeout=100). Anyway, I have added a check for the number of arguments in the code.