Skip to content

Commit 90a60f2

Browse files
Revert urlretrieve_with_retry() to support "filename" argument
This allows urlretrieve_with_retry() to be called with or without filename. Mock tests can continue to pass filename and remain unchanged, since they do not create a temp file using NamedTemporaryFile. maybe_download() will work properly since it will use the temp file created within urlretrieve()
1 parent d760c8a commit 90a60f2

File tree

1 file changed

+2
-2
lines changed
  • tensorflow/contrib/learn/python/learn/datasets

1 file changed

+2
-2
lines changed

tensorflow/contrib/learn/python/learn/datasets/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ def _is_retriable(e):
186186

187187

188188
@retry(initial_delay=1.0, max_delay=16.0, is_retriable=_is_retriable)
189-
def urlretrieve_with_retry(url):
190-
return urllib.request.urlretrieve(url)
189+
def urlretrieve_with_retry(url, filename=None):
190+
return urllib.request.urlretrieve(url, filename)
191191

192192

193193
def maybe_download(filename, work_directory, source_url):

0 commit comments

Comments
 (0)