Python 3 support for append_querystring