Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
488f36b4
Unverified
Commit
488f36b4
authored
Apr 06, 2021
by
Mustafa Bal
Committed by
GitHub
Apr 06, 2021
Browse files
Fixed URLContext Leak (#1429)
parent
6d5e0ba6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
torchaudio/datasets/utils.py
torchaudio/datasets/utils.py
+2
-1
No files found.
torchaudio/datasets/utils.py
View file @
488f36b4
...
@@ -29,7 +29,8 @@ def stream_url(url: str,
...
@@ -29,7 +29,8 @@ def stream_url(url: str,
# If we already have the whole file, there is no need to download it again
# If we already have the whole file, there is no need to download it again
req
=
urllib
.
request
.
Request
(
url
,
method
=
"HEAD"
)
req
=
urllib
.
request
.
Request
(
url
,
method
=
"HEAD"
)
url_size
=
int
(
urllib
.
request
.
urlopen
(
req
).
info
().
get
(
"Content-Length"
,
-
1
))
with
urllib
.
request
.
urlopen
(
req
)
as
response
:
url_size
=
int
(
response
.
info
().
get
(
"Content-Length"
,
-
1
))
if
url_size
==
start_byte
:
if
url_size
==
start_byte
:
return
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment