kennethreitz/requests — pull request #431 by mgiuca (2012-02-15 01:16:31+00:00)
Title: URI cleanup of non-path components

My [previous branch](https://github.com/mgiuca/requests/tree/py3-uri-encoding) fixed URI cleanup for path components. This branch extends that fix to address Issue #429, which requires URI cleanup for the query part of the URI.

I have added comprehensive tests for the sanitisation of the query part of the URI, and rearranged the call to `utils.requote_path` so that it is now applied to the whole URI after it is constructed, and not just the path. Note that this required that all URI components be converted to UTF-8 before the URI is reconstructed (since the URI is now sanitised *after* reconstruction). I have renamed `utils.requote_path` to `requote_uri` to reflect its new role.