internetarchive/infogami

Upgrade infogami/infobase/client.py from urllib to requests

Closed this issue · 4 comments

@cclauss Do we replace the usage of http_cookies.SimpleCookie and urllib_parse imports as well?

from six.moves.http_cookies import SimpleCookie
from six.moves.urllib_parse import urlencode, quote, unquote

In this conversion, we are most worried about replacing calls to urlopen(). While you can get at many of the urllib functions via requests/utils.py, it is often more work than it is worth.

So I would lose the six.moves. part of these imports and just import them from the Python 3 standard library modules.
(I believe that pyupgrade will automate those import transformations.)

Alright, got it. I will do the isort formatting next and then the pyupgrade. In the meantime, try to upgrade urlopen to requests.request.

Also, I will start upgrading from simplejson to json builtin as well.

Closed in #160