Upgrade infogami/infobase/client.py from urllib to requests
Closed this issue · 4 comments
Similar to internetarchive/openlibrary#2852
@cclauss Do we replace the usage of http_cookies.SimpleCookie
and urllib_parse
imports as well?
infogami/infogami/infobase/client.py
Lines 11 to 12 in 14465ab
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.