fix: replace urlretrieve in getRemoteFile#444
fix: replace urlretrieve in getRemoteFile#444chrismattmann merged 2 commits intochrismattmann:masterfrom
urlretrieve in getRemoteFile#444Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Got it, so we have to fix |
|
As I said above, replacing the url to a remote pdf, does help a bit. The error is in It is a common issue: https://www.google.com/search?q=python+urlretrieve+403+forbidden Maybe use custom headers here or switch to using requests. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
urlretrieve in getRemoteFile
|
I suggest splitting the issues discovered during the work on this PR into smaller problems, that can be reviewed individually and merged faster. The "main issue" discovered in this PR is the broken How to proceed from here? Write and use a new helper function? Something like What do you think? |
Yes, perfect let's write a new _urlRetrieve that:
|
|
Merged #446 |
|
Merged #447 |
|
Please check out the proposed helper function. Tests are passing. |
| for chunk in response.iter_content(chunk_size=chunk_size): | ||
| if chunk: # Filter out keep-alive chunks | ||
| f.write(chunk) | ||
| bytes_downloaded += len(chunk) |
There was a problem hiding this comment.
I just realized, that this can be removed. I had a progress bar in mind. But without that, no need for keeping track of the downloaded bytes.
|
LGTM!! |
Failing unit tests
Tasks
urlretrieve