Quote all URLs

This fixes a problem where requests would fail if the path contains a
space.

This is still not a proper solution. A real solution would be to use
urlsplit, apply quote only to the path component, then reassemble the
URL. Urlsplit does not appear to be available in Python 2, though.