Thursday, October 30, 2008

PyUNO broken in OOo 3.0 with system-python

The issue was reported at here. And the solution is also there. I had to add the following lines to the beginning of the scripts DocumentConverter.py and pdfgen.py that come with KnowledgeTree to make them work with OpenOffice.org 3.0 of Mandriva 2009.0:

import os
os.putenv('URE_BOOTSTRAP','vnd.sun.star.pathname:/usr/lib/ooo-3.0/program/fundamentalrc')


Otherwise both scripts will throw out the following error:
AttributeError: loadComponentFromURL

2 comments:

Andrew Z said...

Hey, that's the bug I filed! :) The workaround for Windows uses a slightly different format

http://www.oooforum.org/forum/viewtopic.phtml?p=318751#318751

Unknown said...

For OOo 3.1, URE_BOOTSTRAP should point to fundamentalbasicrc.

Works great with OOo 3.1 64bits (downloaded on openoffice.org) on Ubuntu 9.04 bits,


import os
os.putenv('URE_BOOTSTRAP','vnd.sun.star.pathname:/usr/PATH_TO_YOUR_OOO_INSTALL/ooo-3.0/program/fundamentalbasicrc')