[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: Marshall White <cscidork_at_yahoo.com>
Date: 2003-02-27 22:15:14 CET

I wish I had saved a copy of the error. It's been quite a while.

In Python, calling a function that has more than one output goes something like this:
out1, out2, out3 = foo()

The error said something to the effect of "there are more variables than the number of 'things'
returned from the function." Of course the actual error message didn't use those words exactly,
but that was what "my interpretation."

The error was easy enough to reproduce. I'll revert, rebuild and get back to you with the exact
error message.

Marshall

--- Karl Fogel <kfogel@newton.ch.collab.net> wrote:
> 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 22:16:15 2003

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