Skip to content
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

Fix bugs in resumable_download #1135

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lhotse/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def _download(rq, size):
# sometimes, the server actually supports range requests
# but does not return the Content-Range header with 416 code
# This is out of spec, but let us check twice for pragmatic reasons.
head_req = urllib.request.Request(url, method='HEAD')
head_req = urllib.request.Request(url, method="HEAD")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe "HEAD" and 'HEAD' are equivalent in Python. That is

assert "HEAD" == 'HEAD' == """HEAD""" == '''HEAD'''

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csukuangfj yes, the name of the commit is "run pre-commit" (to make CI happy), this is the edit by black formatter

head_res = urllib.request.urlopen(head_req)
if head_res.headers.get("Accept-Ranges", "none") != "none":
content_length = head_res.headers.get("Content-Length")
Expand Down
Loading