Skip to content

Use an unsigned BYTE for GUID.Data4 on every supported Python - #1017

Merged
junkmd merged 1 commit into
enthought:mainfrom
jeanluyac-sketch:guid-byte-version-bridge
Dec 2, 2026
Merged

junkmd merged 1 commit into
enthought:mainfrom
jeanluyac-sketch:guid-byte-version-bridge

Conversation

@jeanluyac-sketch

Copy link
Copy Markdown
Contributor

Closes #696

ctypes.wintypes.BYTE is the signed c_byte before Python 3.12, while Windows' BYTE (and GUID.Data4) is unsigned. This bridges it to c_ubyte on 3.10/3.11, as proposed in the issue, and adds a test that Data4 is c_ubyte and reads 0xC0 correctly.

Tested on Windows 11: test_GUID passes 9/9 on Python 3.11.9 and 3.14.8. The new test fails on main with 3.11.9 (c_byte is not c_ubyte) and passes with this change. I didn't have 3.10 installed.

AI assistance: drafted with Claude; I reviewed it and ran the tests myself.

@codecov-commenter

codecov-commenter commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.63%. Comparing base (6075f1b) to head (8511a53).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1017   +/-   ##
=======================================
  Coverage   92.62%   92.63%           
=======================================
  Files         154      154           
  Lines       16870    16880   +10     
=======================================
+ Hits        15626    15636   +10     
  Misses       1244     1244           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeanluyac-sketch
jeanluyac-sketch force-pushed the guid-byte-version-bridge branch from f767903 to 8511a53 Compare December 2, 2026 01:24

@junkmd junkmd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you.

@junkmd
junkmd merged commit f020d82 into enthought:main Dec 2, 2026
68 checks passed
@junkmd junkmd added this to the 1.5.1 milestone Dec 2, 2026
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.

Add the version bridge for BYTE in the GUID module.

4 participants