Skip to content

fix(windows): Handle HRESULT - #57

Merged
antirotor merged 4 commits into
developfrom
bugfix/handle-windows-error
Aug 7, 2026
Merged

fix(windows): Handle HRESULT#57
antirotor merged 4 commits into
developfrom
bugfix/handle-windows-error

Conversation

@antirotor

Copy link
Copy Markdown
Owner

Changes

Fixed CopyFile2 HRESULT handling. Failed HRESULTs now raise OSError with the complete HRESULT instead of being silently treated as a successful copy.

@antirotor
antirotor requested a lite review from Copilot August 7, 2026 17:10
@antirotor antirotor self-assigned this Aug 7, 2026
@antirotor antirotor added the bug Something isn't working label Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Windows CopyFile2 error handling in speedcopy by ensuring failed HRESULT return codes are treated as copy failures (raising OSError) rather than being inadvertently treated as success.

Changes:

  • Add an errcheck function for CopyFile2 to detect failed HRESULTs and raise OSError.
  • Add a Windows-only unit test that asserts failed HRESULTs are converted into OSError.
  • Update uv.lock to reflect updated dependency marker/resolution entries.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
speedcopy/win.py Adds HRESULT checking via ctypes errcheck for CopyFile2.
tests/test_speedcopy.py Adds a Windows-only regression test for failed HRESULT handling.
uv.lock Updates lockfile dependency markers/entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread speedcopy/win.py
antirotor and others added 3 commits August 7, 2026 19:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@antirotor
antirotor merged commit a213a89 into develop Aug 7, 2026
7 checks passed
@antirotor
antirotor deleted the bugfix/handle-windows-error branch August 7, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants