You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexey Neyman <st...@att.net> on 2014/08/20 00:08:13 UTC
Python bindings: core.Stream missing close method?
Hi,
It looks like the core.Stream class does not close the underlying streams. It
does save reference to a svn_stream_t wrapper in self._stream, but does not
call svn_stream_close() on its own deletion, nor does the auto-generated
svn_stream_t class do so.
Obviously, it can be closed by calling core.svn_stream_close(s._stream) - but
this accesses private fields not intended to be used as external interfaces.
Am I right that it leaks open streams? If I am - perhaps, fix as attached - to
implement the file-object-like behavior for core.Stream?
Regards,
Alexey.
Re: Python bindings: core.Stream missing close method?
Posted by Ben Reser <be...@reser.org>.
On 8/19/14 11:08 PM, Alexey Neyman wrote:
> Hi,
>
> It looks like the core.Stream class does not close the underlying streams. It
> does save reference to a svn_stream_t wrapper in self._stream, but does not
> call svn_stream_close() on its own deletion, nor does the auto-generated
> svn_stream_t class do so.
>
> Obviously, it can be closed by calling core.svn_stream_close(s._stream) - but
> this accesses private fields not intended to be used as external interfaces.
>
> Am I right that it leaks open streams? If I am - perhaps, fix as attached - to
> implement the file-object-like behavior for core.Stream?
Yup. The wrapped svn_stream_t probably should call close on itself on deletion
but I don't see any problem with the patch so I've applied it in r1619077.
Thanks for the patch.