You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@subversion.apache.org by "Thomas Quinot (JIRA)" <ji...@apache.org> on 2017/03/12 18:20:04 UTC

[jira] [Created] (SVN-4675) bad SWIG Python binding for functions taking multiple pool arguments

Thomas Quinot created SVN-4675:
----------------------------------

             Summary: bad SWIG Python binding for functions taking multiple pool arguments
                 Key: SVN-4675
                 URL: https://issues.apache.org/jira/browse/SVN-4675
             Project: Subversion
          Issue Type: Bug
          Components: bindings_swig_python
         Environment: x86_64-linux
            Reporter: Thomas Quinot


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:
    # https://svn.haxx.se/dev/archive-2014-10/0037.shtml
which is related to the use of global variables to handle optional pool arguments.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)