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/08 17:38:41 UTC

Getting better error messages out of the Python bindings

Hi,

When something fails using the Python bindings, I get the following message:

   SystemError: null argument to internal routine

Is there a way to coax the bindings to get me the *real* error message ?

For example, the following repro recipe exhibits the error:

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

I'm using Subversion 1.1.1 on Win2K SP4.

Thanks !
François

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Getting better error messages out of the Python bindings

Posted by François Beausoleil <fb...@ftml.net>.
(Sorry for the dup. post, Mike)

On 2004-12-08 14:30, C. Michael Pilato wrote:

 > François Beausoleil <fb...@ftml.net> writes:
 >
 >> What's funny is that the path to the core.py file is still
 >> C:\Python23\Lib.
 >
 >
 > What do you mean, "the path to the core.py" file?  Do you not have
 > .../libsvn/core.py and .../svn/core.py?


I mean in the traceback, the paths to svn/core.py is the same, whether 
the files are in lib or lib/site-packages:

C:\Python23\Lib>\test.py
Traceback (most recent call last):
...
   File "C:\Python23\lib\svn\core.py", line 33, in run_app

C:\Python23\Lib>dir *svn* /s/b
C:\Python23\Lib\libsvn
C:\Python23\Lib\svn

(move folders around)

C:\Python23\Lib>\test.py
Traceback (most recent call last):
...
   File "C:\Python23\lib\svn\core.py", line 33, in run_app

C:\Python23\Lib>dir *svn* /s/b
C:\Python23\Lib\site-packages\libsvn
C:\Python23\Lib\site-packages\svn

That's what I meant.

Thanks for your time, Mike.
François

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Getting better error messages out of the Python bindings

Posted by "C. Michael Pilato" <cm...@collab.net>.
François Beausoleil <fb...@ftml.net> writes:

> So, I thought my Subversion bindings installation was correct.  Can some
> Win32 guru tell me where I should put those files ?  I tried moving them
> to C:\Python23\Lib\site-packages, but I get the same error.

That's the right installation place, I think.  I dunno what's causing
the problem, though.  Sorry. :-(

> What's funny is that the path to the core.py file is still
> C:\Python23\Lib.

What do you mean, "the path to the core.py" file?  Do you not have
.../libsvn/core.py and .../svn/core.py?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Getting better error messages out of the Python bindings

Posted by François Beausoleil <fb...@ftml.net>.
Hmmm, let me see:
1.  I downloaded a fresh copy of svn-win32-1.1.1_py.zip today;
2.  I deleted the svn and libsvn folders from C:\Python23\Lib
3.  I unzipped, and moved svn, libsvn to C:\Python23\Lib
4.  I ran Python, to get this:
Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import svn.core
>>> print svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR, 
svn.core.SVN_VER_MICRO

1 1 1

So, I thought my Subversion bindings installation was correct.  Can some
Win32 guru tell me where I should put those files ?  I tried moving them
to C:\Python23\Lib\site-packages, but I get the same error.

What's funny is that the path to the core.py file is still 
C:\Python23\Lib.  Here's some more output:

C:\>test
1 1 1
Traceback (most recent call last):
   File "C:\test.py", line 11, in ?
     main()
   File "C:\test.py", line 8, in main
     core.run_app(repro)
   File "C:\Python23\lib\svn\core.py", line 33, in run_app
   File "C:\test.py", line 4, in repro
     repos.svn_repos_open('no-repos-named-that-way', pool)
SystemError: null argument to internal routine

C:\>dir \Python23\*svn* /s/b
C:\Python23\Lib\site-packages\libsvn
C:\Python23\Lib\site-packages\svn

I used the same script as my initial version.

Thanks,
François


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Getting better error messages out of the Python bindings

Posted by "C. Michael Pilato" <cm...@collab.net>.
François Beausoleil <fb...@ftml.net> writes:

> On 2004-12-08 13:23, C. Michael Pilato wrote:
> > François Beausoleil <fb...@ftml.net> writes:
> >>On my machine, the output looks like this:
> >>1 1 1
> > Somethis is wrong with your bindings, then, because I get:
> >    $ ./test.py    1 2 0
> 
> When was that made ?  Notice I have 1.1.1, not 1.2.0.

I made those changes back in 1.0, I thought.

/me digs around in history a bit... r7983.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Getting better error messages out of the Python bindings

Posted by François Beausoleil <fb...@ftml.net>.
On 2004-12-08 13:23, C. Michael Pilato wrote:
> François Beausoleil <fb...@ftml.net> writes:
>>On my machine, the output looks like this:
>>1 1 1
> Somethis is wrong with your bindings, then, because I get:
> 
>    $ ./test.py 
>    1 2 0

When was that made ?  Notice I have 1.1.1, not 1.2.0.

Thanks !
François

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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)

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

Posted by François Beausoleil <fb...@ftml.net>.
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: Getting better error messages out of the Python bindings

Posted by "C. Michael Pilato" <cm...@collab.net>.
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)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org