Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
use _ffi.from_buffer() to support bytearray #852
Technically speaking, you should call
The reason is: the way Python's buffer protocol works, as long as someone holds a reference to the raw data in the buffer, the original object is pinned. So for example, if you call
OK @njsmith how do you like this one? It has a compat no-op context manager for from_buffer.
Unfortunately from_buffer is smarter than the test mock. I moved the length test past from_buffer in one of the commits because the error message from from_buffer() "wrong type" is nicer than the error message from len() "doesn't have a length"
Missed it by that much
On Tue, Jul 9, 2019, at 5:59 PM, Nathaniel J. Smith wrote: @dholth <https://github.com/dholth> btw, you have a flake8 failure: `tests/test_ssl.py:2103:80: E501 line too long (80 > 79 characters)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#852?email_source=notifications&email_token=AABSZEU5GNR6SKVWROUUQW3P6UC5FA5CNFSM4H65NEKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZRVGJY#issuecomment-509825831>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AABSZEV4U5VX3YGTUTRBP3DP6UC5FANCNFSM4H65NEKA>.