Skip to content

Conversation

@savannahostrowski
Copy link
Member

@savannahostrowski savannahostrowski commented Dec 12, 2025

Spelunking through bugs marked with EOL version labels... The docs aren't explicit about what the second argument should represent. The current behavior (always reporting block size 8192) makes progress tracking unreliable since the last block could be smaller. This change makes reporthook report actual bytes read, which is more useful.

Copy link
Member

@orsenthil orsenthil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This should be back-ported. This is a safe behavior and an improvement.

@savannahostrowski savannahostrowski added 3.13 bugs and security fixes 3.14 bugs and security fixes needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes and removed 3.13 bugs and security fixes 3.14 bugs and security fixes labels Jan 9, 2026
@savannahostrowski savannahostrowski enabled auto-merge (squash) January 9, 2026 00:17
@savannahostrowski savannahostrowski merged commit 68a01f9 into python:main Jan 9, 2026
46 checks passed
@miss-islington-app
Copy link

Thanks @savannahostrowski for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 9, 2026
@bedevere-app
Copy link

bedevere-app bot commented Jan 9, 2026

GH-143588 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jan 9, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 9, 2026
@bedevere-app
Copy link

bedevere-app bot commented Jan 9, 2026

GH-143589 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jan 9, 2026
@picnixz
Copy link
Member

picnixz commented Jan 9, 2026

There is a call to reporthook just a few lines above before reading the first block. Would it not weird?

@picnixz
Copy link
Member

picnixz commented Jan 9, 2026

Also the docs say

The callable will be passed three arguments; a count of blocks transferred so far, a block size in bytes, and the total size of the file.

I am not sure that passing the kength of the block that was just read is the 'block size' in this case. Or maybe we should documenty it better.

We should also document for blocknum == 0 that we first give the blocksize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants