Apache OpenOffice (AOO) Bugzilla – Issue 88211
PyUNO broken in OOo 3.0 DEV300
Last modified: 2013-02-24 21:06:25 UTC
Two PyUNO programs I've used in OOo 1.1.5 - OOo 2.4.0 no longer work in OOo 3.0 DEV300_m3 to DEV300_m6. I even tested the PyUNO hello world. Maybe I am doing something stupid? :) Attempt #1 1. Copy hello_world.py from http://udk.openoffice.org/python/python-bridge.html 2. /home/z/programs/ooo300_m6/openoffice.org3.0/program/soffice "-accept=socket,host=localhost,port=2002;urp;StarOffice.ServiceManager" -norestore -nofirststart -nologo -headless 3. ~/programs/ooo300_m6/openoffice.org/basis3.0/program/python.sh /tmp/hello.py Traceback (most recent call last): File "/tmp/hello.py", line 18, in ? model = desktop.getCurrentComponent() AttributeError: getCurrentComponent Attempt #2 1. Download http://www.artofsolving.com/opensource/pyodconverter 2. /home/z/programs/ooo300_m6/openoffice.org3.0/program/soffice -accept="socket,port=8100;urp;" 3. /programs/ooo300_m6/openoffice.org/basis3.0/program/python.sh /tmp/DocumentConverter.py /tmp/foo.odt /tmp/foo.doc Traceback (most recent call last): File "/tmp/DocumentConverter.py", line 139, in ? converter.convert(argv[1], argv[2]) File "/tmp/DocumentConverter.py", line 99, in convert document = self.desktop.loadComponentFromURL(inputUrl, "_blank", 0, _unoProps(Hidden=True, ReadOnly=True)) AttributeError: loadComponentFromURL
jsc -> sb: as discussed to you
yet another victim of the new three-layer office
fixed; as somewhat of a hack, added -env:INIFILEPATH=$sd_prog/redirectrc arg when starting python.bin from python.sh, so that a later defaultBootstrap_InitialComponentContext() will bootstrap into a complete OOo UNO env
#desc4 was by mistake; fixed correctly now (without hacks); on Unix there is <brand-layer>/program/python shell script (no superfluous, extra python.sh any longer), on Windows there is <brand-layer>\program\python.exe now (formerly python.bat).
@jsk: please verify
Verified on Linux using the hello-world python sample. Needed to make sure a writer document is open first and the script had to be executed from the <brand>/program directory - "./python hello-world.py"
cmc->sb: What was the substantive part of this fix ? Trying to figure out how (if possible) to fix the "using system python" case.
@cmc: lets please continue at issue 90701
Closed.