[redland-dev] Redland_python.unicode_to_bytes
Dave Beckett
dave at dajobe.org
Thu Jun 24 17:00:47 CEST 2010
I am guessing it is the recent python change to no longer allow string exceptions. Seems like an ABI break to me but that seems to be what has happened.
Dave
On Jun 23, 2010, at 2:35, "Jasper OP DE COUL" <jasper at infrae.com> wrote:
> Hi,
>
> I'm using the the python redland bindings in ubuntu lucid
>
> (http://packages.ubuntu.com/en/lucid/python-librdf)
>
> and I'm having problems creating RDF.Node objects from unicode,
> sometimes (not always) the following exception occurs:
>
>>>> import RDF
>>>> RDF.Node(u'foobarfoobarfoo')
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/lib/python2.6/dist-packages/RDF.py", line 270, in __init__
> args['literal'] = Redland_python.unicode_to_bytes(arg)
> SystemError: error return without exception set
>
> Looking at Redland_python.unicode_to_bytes, I get
>
>>>> Redland_python.unicode_to_bytes(u'foo')
> 'foo\x00\x00'
>>>> Redland_python.unicode_to_bytes(u'foobar')
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> SystemError: error return without exception set
>>>> Redland_python.unicode_to_bytes(u'foobar')
> 'foobar\x00\x00\x00\x00'
>>>> Redland_python.unicode_to_bytes(u'foobarbaz')
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> SystemError: error return without exception set
>>>> Redland_python.unicode_to_bytes(u'foobarbaz')
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> SystemError: error return without exception set
>>>> Redland_python.unicode_to_bytes(u'foobarbaz')
> 'foobarbaz\x00foo\x00'
>
>
> Is this a bug in Redland, or is it something Ubuntu specific?
> I did a manual build using the redland-bindings-1.0.10.1 tarball
> but had the same problem.
>
> Regards,
> Jasper
>
> --
> Jasper Op de Coul -- Infrae
> t +31 10 243 7051 -- http://infrae.com
> Hoevestraat 10 3033GC Rotterdam -- The Netherlands
> _______________________________________________
> redland-dev mailing list
> redland-dev at lists.librdf.org
> http://lists.librdf.org/mailman/listinfo/redland-dev
>
More information about the redland-dev
mailing list