[redland-dev] Python binding bug

Anahide Tchertchian at at nuxeo.com
Tue Feb 7 15:32:58 GMT 2006


Hi,

I've been trying to use the tracker, but I keep on running into an error 
"APPLICATION ERROR #1303 Invalid value for field" when submitting, so 
I'm posting here.

Experienced using version 1.0.2.1.

RedlandError raised is not always a Python class

Some errors coming from Redland are not raised as RedlandError instances 
from the binding, making it impossible to catch them in Python code.

This has been experienced, for instance, creating a mysql storage 
without using the "new='yes'" option whereas tables do not exist. Code 
showing the problem follows.

 >>> import RDF
 >>> options = 
"host='localhost',port=3306,user='test',password='test',database='test_redland'"
 >>> try:
...     storage = RDF.Storage(storage_name="mysql", name='test_redland', 
options_string=options)
... except RDF.RedlandError:
...     print "error"
...
Traceback (most recent call last):
   File "<stdin>", line 2, in ?
   File "/usr/lib/python2.4/site-packages/RDF.py", line 1482, in __init__
     args['storage_name'], args['name'], args['options_string'])
RDF.RedlandError: MySQL select from Models table failed: Table 
'test_redland.Models' doesn't exist
 >>> try:
...     storage = RDF.Storage(storage_name="mysql", name='test_redland', 
options_string=options)
... except Exception, err:
...     print "error"
...
error
 >>> isinstance(err, RDF.RedlandError)
False
 >>> err.__class__
<class RDF.RedlandError at 0xb7d5ca7c>
 >>> RDF.RedlandError('test').__class__
<class RDF.RedlandError at 0xb7d5c98c>

Regards,

-- 
Anahide Tchertchian, Nuxeo (Paris, France)
Mail: at at nuxeo.com - Tel: +33 (0)1 40 33 71 60
CPS Platform: http://www.cps-project.org


More information about the redland-dev mailing list