The release() cannot be missed, otherwise the bytearray would become size-immutable, for a non-deterministic time, until the PyBuffer gets garbage-collected. It's like memoryview in this way.

Leaving Java 6 behind, I believe we could give it the AutoCloseable interface, and use try-with-resources to simplify our code, but you didn't have that to help you.
Jeff Allen
On 10/05/2014 22:02, Indra Talip wrote:
No worries.

I did wonder if I had been a bit overly paranoid by using a try {…} finally { buffer.release(); } pattern, but I figured it was probably better to be paranoid than accidentally not release a buffer.


On 11 May 2014 03:04, Jeff Allen <> wrote:
It's very satisfying to see the BufferProtocol used by someone other than me. (Correctly too, I think.) Now I feel I must've I explained it well enough for it to make its own way in the world!


Jeff Allen

On 10/05/2014 16:38, Jim Baker wrote:
Jim Baker added the comment:

Merged as of 7239:d3bad92dfc5b

resolution:  -> fixed
status: open -> closed

Jython tracker <>

Indra Talip