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

Re: Rcsparse.py

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2003-02-27 20:59:23 CET

Marshall White <cscidork@yahoo.com> writes:
> Another message in that thread has a potential patch to fix it.
>
> In the current bindings SOME functions that have "const char **"
> parameters return Pythong string objects and some do not (they
> return that *_p_char crap instead). From the digging around I did,
> it looked like they ALL should work the same way. That was what my
> patch did.

I haven't applied your patch from

   http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=30416

because I'm having trouble understanding whether it's correct. If a C
function returns a NULL string by reference, it seems your patch would
convert it to the empty string, instead of to None. For example,
assuming this commit is successful:

   const char *conflict_path;
   svn_revnum_t new_rev;
   SVN_ERR (svn_fs_commit_txn (&conflict_path, &new_rev, txn));

... then up at the Python level, conflict_path would look like ''
instead of None.

Clearly this is intentional; your log message even says it:

   * subversion/bindings/swig/svn_string.i
   (%typemap(python,argout,fragment="t_output_helper") const char **OUTPUT):
   Return an empty string instead of a Py_None binding. If the Python code
   is expecting something, and the function generates nothing, a run-time
   error will result.
   Added "in,numinputs=0" and an initial value for "temp" to
   (%typemap(python,in,numinputs=0) const char **OUTPUT
   (const char *temp = (const char *)0))

But what exactly is the error that will result if we just use None
here? It's kind of weird to get '' back when None is the more
intuitive value ('' could even be considered incorrect, as it implies
a conflict on the root directory).

Whatever problems you were seeing might be related to the problems
that revision 5137 works around. I'll write about those in a separate
mail.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 27 21:34:07 2003

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

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