-
Notifications
You must be signed in to change notification settings - Fork 382
Replace urllib by requests in contentproviders #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Any chance to have this PR being merged? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the super slow response. I ended up taking some time off from maintaining duties to recharge.
I left a few nit picks but otherwise this looks like a huge effort and as far as I can tell it doesn't change anything in the tests besides switching the mock. This is a good thing :)
repo2docker/contentproviders/doi.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as further down: useful for the average user on a day to day basis or more of a debug help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Previsouly, this fetchfile() method did log (as generated strings):
- the directory creation ("Creating [...]"),
- the saving of the downloaded zip file in
dst_fname
("Fetching [...]") - the zip file extraction ("Extracting [...]")
- the list of extracted files ("Extracted [...]")
In my version of the code, the only thing logged in addition to these is the "Requesting [...]" line in which I display the actually retrieved URL (after doi resolution) I though would be useful in a log.
requests is globally simpler to use, and more and more people are more familiar with this later than urllib.
requests is globally simpler to use, and more and more people
are more familiar with this later than urllib.
See #988 for a discussion on why this is needed.