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

Re: Test failures on the ctypes-python-bindings branch

From: David James <james_at_cs.toronto.edu>
Date: Mon, 11 Aug 2008 07:39:48 -0700

On Sun, Aug 10, 2008 at 1:59 PM, Arfrever Frehtes Taifersar Arahesis
<arfrever.fta_at_gmail.com> wrote:
> Some tests fail on the ctypes-python-bindings branch:
> $ test/run_all.py
> .E...EEEE..E.Segmentation fault
> Running tests manually gives more useful information:
> $ test/localrepos.py
> .E.
> ======================================================================
> ERROR: test_local_get_prop (__main__.LocalRepositoryTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test/localrepos.py", line 36, in test_local_get_prop
> self.repos.get_rev_prop(8, "svn:log")
> File "/home/Arfrever/subversion_ctypes-python-bindings/csvn/repos.py", line 428, in get_rev_prop
> return _types.SvnStringPtr.from_param(value)
> File "/home/Arfrever/subversion_ctypes-python-bindings/csvn/types.py", line 257, in from_param
> return string_at(obj[0].data.raw, obj[0].len)
> AttributeError: 'str' object has no attribute 'raw'
> [...]

Hi Arfrever,

It looks like this is a bug in ctypesgen. Revision 51 of ctypesgen
works fine, but revision 52 and 53 produce the errors you mentioned.

Tim, could you look into this? The bug in ctypesgen seems to be that
ctypesgen now outputs "c_char_p" and "Pointer(char) instead of String.
r53 seems to be better than r52 but still forgets to output String in
a bunch of places.

By the way, the reason why we use String instead of c_char_p is
because c_char_p assumes that the string is null terminated -- this
may be a bad assumption. There is no way to get at the internals of
the string if it returns c_char_p. On the other hand, if you return
POINTER(char), you are forced to convert between strings and pointers
manually. The String class makes both the POINTER(char) and the String
interface available, and therefore is always safe to use in place of a
c_char_p or POINTER(char).



To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-08-11 16:40:03 CEST

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.