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

Re: Learning the Python API - early questions

From: Barry Scott <barry_at_barrys-emacs.org>
Date: 2003-10-07 23:58:11 CEST

At 06-10-2003 19:45, Russell Yanofsky wrote:
>[The bottom part of my previous post somehow got cut off. Here it is.]
>
>Barry Scott wrote:
> > At the moment an error in the python code will drop me into
> > Dev Studio to debug the exception. It would be nice for the
> > wrappers to raise python exceptions rather then enter the svn
> > code and hit the assert calls or fall off the end of NULL
> > pointers.
>
>This is an issue I'm not really sure how to deal with. When you misuse an
>API in C, it's expected that you will get failed assertions and null pointer
>deferences. But python users expect exceptions to explain the error
>conditions, and except when it comes to type checking, swig doesn't provide
>this. It is possible to manually add checks, for example we could easily
>raise a python exception when the "ctx" argument passed to svn_client_ls()
>has a NULL "auth_baton" member. But we can't manually check for every error
>condition.

Is could be fixed in the C API or the Python wrapper. If the C API converted
misuse to error codes then the python would just throw python exceptions with
ease.

Again the RapidSVN api may make this a lot easier. I'm watching for the patch
to bring RapidSVN up to 0.30.0 compatibility.

Barry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Oct 7 23:59:06 2003

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

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