Skip to content

gh-152433: Windows: use GetFileSizeEx instead of GetFileSize#152383

Open
thexai wants to merge 1 commit into
python:mainfrom
thexai:windows-getfilesizeex
Open

gh-152433: Windows: use GetFileSizeEx instead of GetFileSize#152383
thexai wants to merge 1 commit into
python:mainfrom
thexai:windows-getfilesizeex

Conversation

@thexai

@thexai thexai commented Jun 27, 2026

Copy link
Copy Markdown

GetFileSizeEx is available in all supported Windows versions and has the advantage is also present in UWP, then allows build also in UWP with the same common code.

It also simplifies error checking and makes handling files larger than 4GB easier.

The ultimate goal is to upstream some of Kodi patches required to build Python for Xbox... This is just the first step.

@bedevere-app

bedevere-app Bot commented Jun 27, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@python-cla-bot

python-cla-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@thexai

thexai commented Jun 27, 2026

Copy link
Copy Markdown
Author

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

This change is transparent: users won't notice anything different.

@thexai thexai changed the title [Windows] Use GetFileSizeEx instead of GetFileSize gh-152433: Windows: use GetFileSizeEx instead of GetFileSize Jun 27, 2026
@chris-eibl chris-eibl self-requested a review June 27, 2026 18:21

@chris-eibl chris-eibl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, LGTM. Even less code and works the same as before on all supported Windows platforms.

I'm on the fence regarding a news entry - leaving it up to @zooba

GetFileSizeEx is available in all supported Windows versions and has the
advantage is also present in UWP, then allows build also in UWP with
the same common code.

It also simplifies error checking and makes handling files larger
than 4GB easier.
@thexai thexai force-pushed the windows-getfilesizeex branch from fb47fb6 to 8b9c4cb Compare June 28, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants