Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python 3.12.3 regression with enums #616

Merged
merged 8 commits into from Apr 14, 2024
Merged

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Apr 12, 2024

Python 3.12.3 recently released and (again) changed the behavior of the enum module: python/cpython#116040

Zigpy isn't affected so I've replaced all bellows types with zigpy types to hopefully avoid these issues in the future.

@puddly
Copy link
Contributor Author

puddly commented Apr 12, 2024

Looks like there was a pretty big bug with the old types:

(Pdb) t.uint16_t.deserialize(b'\x06')
(6, b'')

This should not have deserialized.

Copy link

codecov bot commented Apr 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.67%. Comparing base (bf634b5) to head (49a1c15).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #616      +/-   ##
==========================================
- Coverage   99.68%   99.67%   -0.01%     
==========================================
  Files          74       74              
  Lines        5014     4874     -140     
==========================================
- Hits         4998     4858     -140     
  Misses         16       16              

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

@puddly
Copy link
Contributor Author

puddly commented Apr 12, 2024

It looks like the integer parsing problem is pretty widespread. This branch runs for me on EZSP v13 but it needs to be runtime tested on all previous protocols too...

@puddly
Copy link
Contributor Author

puddly commented Apr 14, 2024

Tested with protocol versions 4, 8, and 13. I think this is fine to merge.

@puddly puddly merged commit 7833647 into zigpy:dev Apr 14, 2024
14 checks passed
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.

None yet

1 participant