This can be caused by a couple of different reasons, but here is the most common cause we’ve seen. When you establish your Shotgun connection:
sg = Shotgun(SG_SERVER, SG_SCRIPT_NAME, SG_SCRIPT_KEY)
If the strings you use in your connection are Unicode, that will cause the aforementioned error. Be sure your strings are ASCII when establishing your connection, and you’ll be good to go!