[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

AW: Python bindings: Use of svn_swig_py_make_stream() - avoiding leaking fds

From: Markus Schaber <m.schaber_at_3s-software.com>
Date: Mon, 9 May 2011 10:05:16 +0200

Hi, Hick,

> Von: Piper, Nick [mailto:nick.piper_at_logica.com]
 
> In Python, f is a "file" instance, but that will be converted to a
> svn_stream_t by swig (by svn_swig_py_make_stream()).
>
> That file then goes out of scope in Python, but the file descriptor is
> never closed. I don't see where we should be calling
svn_stream_close() in
> order to do that (and call Py_DECREF(py_io)), because the svn_stream_t
is
> never exposed back to Python.

I'm not sure about what svn_swig_py_make_stream() does, but normal
python files automatically close the underlying os resources (file
descriptor etc.) when they are garbage collected.

Best regards

Markus Schaber
Received on 2011-05-09 10:05:53 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.