python-urlopen 0.0.4__tar.gz → 0.0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_urlopen-0.0.4 → python_urlopen-0.0.4.1}/PKG-INFO +1 -1
- {python_urlopen-0.0.4 → python_urlopen-0.0.4.1}/pyproject.toml +1 -1
- {python_urlopen-0.0.4 → python_urlopen-0.0.4.1}/urlopen/__init__.py +2 -2
- {python_urlopen-0.0.4 → python_urlopen-0.0.4.1}/LICENSE +0 -0
- {python_urlopen-0.0.4 → python_urlopen-0.0.4.1}/readme.md +0 -0
- {python_urlopen-0.0.4 → python_urlopen-0.0.4.1}/urlopen/__main__.py +0 -0
- {python_urlopen-0.0.4 → python_urlopen-0.0.4.1}/urlopen/py.typed +0 -0
|
@@ -209,7 +209,7 @@ def download(
|
|
|
209
209
|
resp = urlopen(url, headers={**headers, "Range": "bytes=%d-" % filesize}, **urlopen_kwargs)
|
|
210
210
|
if not is_range_request(resp):
|
|
211
211
|
raise OSError(errno.EIO, f"range request failed: {url!r}")
|
|
212
|
-
if reporthook:
|
|
212
|
+
if reporthook is not None:
|
|
213
213
|
reporthook(filesize)
|
|
214
214
|
elif resume:
|
|
215
215
|
for _ in bio_skip_iter(resp, filesize, callback=reporthook):
|
|
@@ -219,7 +219,7 @@ def download(
|
|
|
219
219
|
fdst_write = fdst.write
|
|
220
220
|
while (chunk := fsrc_read(chunksize)):
|
|
221
221
|
fdst_write(chunk)
|
|
222
|
-
if reporthook:
|
|
222
|
+
if reporthook is not None:
|
|
223
223
|
reporthook(len(chunk))
|
|
224
224
|
finally:
|
|
225
225
|
resp.close()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|