-
Notifications
You must be signed in to change notification settings - Fork 121
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 to work with Bleak on a mac #78
Conversation
Codecov Report
@@ Coverage Diff @@
## master #78 +/- ##
==========================================
- Coverage 75.76% 75.11% -0.66%
==========================================
Files 18 20 +2
Lines 2080 2270 +190
==========================================
+ Hits 1576 1705 +129
- Misses 504 565 +61
Continue to review full report at Codecov.
|
Thanks for your investigations! I think the fix should be slightly modified, though. Instead of modifying generic parts of the library, the fix should be local to cbleak.py. Speficially around this line: https://github.com/undera/pylgbst/blob/master/pylgbst/comms/cbleak.py#L81 The reason is that generic part of lib assumes certain data types for payloads, and we should not let any implementation-specific type to slip into. So doing type conversion on Again, I myself don't have Mac to validate this, so relying on you here... |
I agree, I tried it but it didn't work, but there must be a way to copy bytes from _NSInlineData into real bytes and pass it over, I will clean it up |
Overall this looks like a bug in Bleak itself, that it leaks internal |
This might be a pointer to a solution: https://github.com/Charliealver/bleak/pull/1/files#diff-8f13c6112bf9c88568af14b21a928142R183 |
Sometimes the data returnes is not byte/bytes, but native objective-c class _NSInlineData. Seems to be a bleak bug, just convert it to bytes as workaround for now.
any objections? |
All is good, thanks |
btw I don't have time to test, but it looks like the second version of the fix, which actually translated it into bytes just magically fixed all the instability issues we had before. |
even though isinstance will fail, otherwise it seems to be working