style: tighten comments added on this branch

This commit is contained in:
imSp4rky
2026-08-07 11:43:13 -06:00
parent d16e8b32ee
commit 9466db37a6
6 changed files with 13 additions and 14 deletions
+3 -3
View File
@@ -742,9 +742,9 @@ def download(
if item_range and not part_mode and stream.status_code != 206:
# server ignored the slice's Range and sent the whole parent (RFC 9110 allows
# a 200 here); writing that as the segment would silently corrupt the merge,
# so fail the attempt — unless the slice spans the whole resource, in which
# case the 200 body is byte-identical to the 206 and safe to keep
# a 200 here); writing that as the segment would silently corrupt the merge, so
# fail the attempt unless the slice spans the whole resource, in which case the
# 200 body is byte-identical to the 206 and safe to keep
if not (stream.status_code == 200 and _range_covers_full_body(req_headers, content_length)):
raise IOError(f"expected 206 for byte-range segment, got {stream.status_code}")
+2 -2
View File
@@ -840,8 +840,8 @@ def session(
# connect_timeout + read_timeout mirror the requests-path default timeout (CONNECT_TIMEOUT, READ_TIMEOUT)
# so an unset config still gets a bounded connect and read like requests; pool_idle_timeout stays under
# the typical ~60s CDN idle kill; pool_max_idle_per_host follows POOL_MAX_SIZE, sized above the worker
# cap because hedge racers and tail-boost parts push in-flight requests past it (see POOL_MAX_SIZE);
# tcp_keepalive keeps long idle segments warm.
# cap because hedge racers and tail-boost parts push in-flight requests past it; tcp_keepalive keeps
# long idle segments warm.
session_kwargs.setdefault("connect_timeout", CONNECT_TIMEOUT)
session_kwargs.setdefault("read_timeout", READ_TIMEOUT)
session_kwargs.setdefault("pool_idle_timeout", 55)