Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.9.3
-
None
-
None
-
x86_64-linux
Description
Running the following script:
----------
import svn.core
def do_stuff(pool):
s=svn.core.svn_stream_open_writable("/tmp/somefile")
print s
svn.core.run_app(do_stuff)
----------
will display:
Traceback (most recent call last):
File "bug1.py", line 5, in <module>
svn.core.run_app(do_stuff)
File "/usr/lib/python2.7/dist-packages/svn/core.py", line 345, in run_app
return func(application_pool, *args, **kw)
File "bug1.py", line 4, in do_stuff
print s
File "/usr/lib/python2.7/dist-packages/libsvn/core.py", line 5589, in _getattr_
self.assert_valid()
File "/usr/lib/python2.7/dist-packages/libsvn/core.py", line 5585, in assert_valid
assert self._dict_["_is_valid"](), "Variable has already been deleted"
AssertionError: Variable has already been deleted
If "pool" is passed explicitly as the pool and scratch pool in the call to svn_stream_open_writable however, the expected output will be observed:
<libsvn.core.svn_stream_t; proxy of <Swig Object of type 'svn_stream_t *' at 0x7f0903e6eab0> >
I believe that this is the same bug originally discussed here:
which is related to the use of global variables to handle optional pool arguments (unlike e.g. the Ruby binding, which pushes pool arguments on a stack, so that multiple such arguments are properly freed upon return).
I was able to reproduce this with 1.9.3. It looks to me like the mapping wasn't substantially changed since then so this probably impacts the latest trunk version as well.