You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by François Beausoleil <fb...@ftml.net> on 2004/12/13 14:13:48 UTC

Python Win32 bindings broken ? (Was Re: Getting better error messages out of the Python bindings)

Hi !

I have a problem with the Subversion Python Win32 bindings.  The gist of 
it is that I can't get any useful error messages out of Subversion's 
libraries.

cmpilato was gracious enough to offer me some help, earlier on, but he 
was using Linux, and he had no Win32 box to use.

If someone with Win32 could try the following script, or cmpilato's 
modified one, I would be grateful.  This problem is preventing me from 
continuing on developing RSVN, at the moment.  If the problem can be 
found, then I'll be fine from here on.

BTW, this problem is not specific to me:

Thanks !
François

On 08/12/2004 13:23, C. Michael Pilato wrote:
> François Beausoleil <fb...@ftml.net> writes:
> 
>>from svn import core, fs, repos
>>
>>def repro(pool):
>>   repos.svn_repos_open('no-repos-named-that-way', pool)
>>
>>def main():
>>   print core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO
>>   core.run_app(repro)
>>
>>if __name__ == '__main__':
>>   main()
>>
>>On my machine, the output looks like this:
>>1 1 1
>>Traceback (most recent call last):
>>   File "C:\java\rsvn\recipe.py", line 11, in ?
>>     main()
>>   File "C:\java\rsvn\recipe.py", line 8, in main
>>     core.run_app(repro)
>>   File "C:\Python23\lib\svn\core.py", line 33, in run_app
>>     return apply(func, (pool,) + args, kw)
>>   File "C:\java\rsvn\recipe.py", line 4, in repro
>>     repos.svn_repos_open('no-repos-named-that-way', pool)
>>SystemError: null argument to internal routine
> 
> 
> Somethis is wrong with your bindings, then, because I get:
> 
>    $ ./test.py 
>    1 2 0
>    Traceback (most recent call last):
>      File "./test.py", line 12, in ?
>        main()
>      File "./test.py", line 9, in main
>        core.run_app(repro)
>      File "/usr/lib/python2.3/site-packages/svn/core.py", line 37, in run_app
>        return apply(func, (pool,) + args, kw)
>      File "./test.py", line 5, in repro
>        repos.svn_repos_open('no-repos-named-that-way', pool)
>    libsvn._core.SubversionException: ("Can't open file 'no-repos-named-that-way/format': No such file or directory", 2)
> 
> I designed those SubversionException errors such that you can grab
> their apr_err member to get the numeric errorcode, too.  So this
> slightly tweaked version of you script:
> 
>    #!/usr/bin/python
>    from svn import core, fs, repos
>    
>    def repro(pool):
>       try:  
>          repos.svn_repos_open('no-repos-named-that-way', pool)
>       except core.SubversionException, e:
>          print "ERROR (code=%d): %s" % (e.apr_err, str(e))
>    
>    def main():
>       print core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO
>       core.run_app(repro)
>    
>    if __name__ == '__main__':
>       main()
> 
> produces this output:
> 
>    $ ./test.py 
>    1 2 0
>    ERROR (code=2): ("Can't open file 'no-repos-named-that-way/format': No such file or directory", 2)

Re: Python Win32 bindings broken ? (Was Re: Getting better error messages out of the Python bindings)

Posted by François Beausoleil <fb...@ftml.net>.
(Sorry, the mail was sent before I completed it...)

Hi !

I have a problem with the Subversion Python Win32 bindings.  The gist of
it is that I can't get any useful error messages out of Subversion's
libraries.

cmpilato was gracious enough to offer me some help, earlier on, but he
was using Linux, and he had no Win32 box to use.

If someone with Win32 could try the following script, or cmpilato's
modified one, I would be grateful.  This problem is preventing me from
continuing on developing RSVN, at the moment.  If the problem can be
found, then I'll be fine from here on.

BTW, this problem is not specific to me:
Arnout Standaert reported the same problem on 2004-12-10: 
http://svn.haxx.se/users/archive-2004-12/0603.shtml

Quoting Arnout:
 > But I'm slipping into more serious trouble, so it seems :-)
 > Currently I'm not able to solve this one:
 >
 > Traceback (most recent call last):
 >   File "e:\SVN\testing\hooks\mailer.py", line 754, in ?
 >     author, propname)
 >   File "c:\Python23\lib\svn\core.py", line 33, in run_app
 >     return apply(func, (pool,) + args, kw)
 >   File "e:\SVN\testing\hooks\mailer.py", line 36, in main
 >     repos = Repository(repos_dir, rev, pool)
 >   File "e:\SVN\testing\hooks\mailer.py", line 558, in __init__
 >     self.root_this = self.get_root(rev)
 >   File "e:\SVN\testing\hooks\mailer.py", line 570, in get_root
 >     root = self.roots[rev] = svn.fs.revision_root(self.fs_ptr, rev,
self.pool)
 > SystemError: null argument to internal routine

There are other reports of similar problems, and all have one thing in 
comming - Windows:

http://svn.haxx.se/users/archive-2004-03/1292.shtml
http://svn.haxx.se/users/archive-2004-06/1283.shtml
http://svn.haxx.se/users/archive-2004-10/0295.shtml
http://svn.haxx.se/dev/archive-2004-05/0812.shtml

Thanks !
François

> On 08/12/2004 13:23, C. Michael Pilato wrote:
> 
>> François Beausoleil <fb...@ftml.net> writes:
>>
>>> from svn import core, fs, repos
>>>
>>> def repro(pool):
>>>   repos.svn_repos_open('no-repos-named-that-way', pool)
>>>
>>> def main():
>>>   print core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO
>>>   core.run_app(repro)
>>>
>>> if __name__ == '__main__':
>>>   main()
>>>
>>> On my machine, the output looks like this:
>>> 1 1 1
>>> Traceback (most recent call last):
>>>   File "C:\java\rsvn\recipe.py", line 11, in ?
>>>     main()
>>>   File "C:\java\rsvn\recipe.py", line 8, in main
>>>     core.run_app(repro)
>>>   File "C:\Python23\lib\svn\core.py", line 33, in run_app
>>>     return apply(func, (pool,) + args, kw)
>>>   File "C:\java\rsvn\recipe.py", line 4, in repro
>>>     repos.svn_repos_open('no-repos-named-that-way', pool)
>>> SystemError: null argument to internal routine
>>
>>
>>
>> Somethis is wrong with your bindings, then, because I get:
>>
>>    $ ./test.py    1 2 0
>>    Traceback (most recent call last):
>>      File "./test.py", line 12, in ?
>>        main()
>>      File "./test.py", line 9, in main
>>        core.run_app(repro)
>>      File "/usr/lib/python2.3/site-packages/svn/core.py", line 37, in 
>> run_app
>>        return apply(func, (pool,) + args, kw)
>>      File "./test.py", line 5, in repro
>>        repos.svn_repos_open('no-repos-named-that-way', pool)
>>    libsvn._core.SubversionException: ("Can't open file 
>> 'no-repos-named-that-way/format': No such file or directory", 2)
>>
>> I designed those SubversionException errors such that you can grab
>> their apr_err member to get the numeric errorcode, too.  So this
>> slightly tweaked version of you script:
>>
>>    #!/usr/bin/python
>>    from svn import core, fs, repos
>>       def repro(pool):
>>       try:           repos.svn_repos_open('no-repos-named-that-way', 
>> pool)
>>       except core.SubversionException, e:
>>          print "ERROR (code=%d): %s" % (e.apr_err, str(e))
>>       def main():
>>       print core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO
>>       core.run_app(repro)
>>       if __name__ == '__main__':
>>       main()
>>
>> produces this output:
>>
>>    $ ./test.py    1 2 0
>>    ERROR (code=2): ("Can't open file 'no-repos-named-that-way/format': 
>> No such file or directory", 2)