Fixed an issue with partially encoded query strings on Python 3