bytearray is a bytes-like object
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 944
- Forks
- 440
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 6
Description
In [1]: from OpenSSL import SSL
In [2]: ctx = SSL.Context(SSL.SSLv23_METHOD)
In [3]: conn = SSL.Connection(ctx, None)
In [4]: conn.set_accept_state()
In [5]: conn.send(bytearray(10))
TypeError: data must be a memoryview, buffer or byte string
But bytearrays are nice and friendly and deserve your love too!
Actually I'd expect that it should accept anything that implements the buffer interface, using ffi.from_buffer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the SSL.Connection.send entry point and inspect how its input is passed to OpenSSL, then compare that path with ffi.from_buffer. Done means bytearray and other buffer-interface inputs are accepted without the shown TypeError, with coverage added in the relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking, security
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100