Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4c29fc2

Browse filesBrowse files
[3.13] gh-134262: Fix off by one errors in download retry functions (GH-137775)
(cherry picked from commit e64395e) Co-authored-by: Emma Smith <emma@emmatyping.dev>
1 parent a335967 commit 4c29fc2
Copy full SHA for 4c29fc2

2 files changed

+2-2Lines changed: 2 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎PCbuild/get_external.py‎

Copy file name to clipboardExpand all lines: PCbuild/get_external.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def retrieve_with_retries(download_location, output_path, reporthook,
1313
max_retries=7):
1414
"""Download a file with exponential backoff retry and save to disk."""
15-
for attempt in range(max_retries):
15+
for attempt in range(max_retries + 1):
1616
try:
1717
resp = urlretrieve(
1818
download_location,
Collapse file

‎Tools/build/generate_sbom.py‎

Copy file name to clipboardExpand all lines: Tools/build/generate_sbom.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def download_with_retries(download_location: str,
172172
base_delay: float = 2.25,
173173
max_jitter: float = 1.0) -> typing.Any:
174174
"""Download a file with exponential backoff retry."""
175-
for attempt in range(max_retries):
175+
for attempt in range(max_retries + 1):
176176
try:
177177
resp = urllib.request.urlopen(download_location)
178178
except urllib.error.URLError as ex:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.