Bug 123962 - openoffice can not execute python scripts
Bug#: 123962 Product:  Gentoo Linux Version: 2005.1 Platform: All
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: openoffice@gentoo.org Reported By: acgen@achome.net
Component: Applications
URL:  http://udk.openoffice.org/python/scriptingframework/push_me_python4.odt
Summary: openoffice can not execute python scripts
Keywords:  
Status Whiteboard: 
Opened: 2006-02-24 09:59 0000
Description:   Opened: 2006-02-24 09:59 0000
This is for app-office/openoffice-bin

When try to open a document with python script openoffice says
"Message: The scripting language Python is not supported".

After an investigation I found that openoffice looks for python in
/usr/lib/openoffice/program/python-core
but there is no such directory there after installation.
There is only
/usr/lib/openoffice/program/python-core-2.3.4

I made a link /usr/lib/openoffice/program/python-core -> python-core-2.3.4

After that if I start ooffice2 from terminal and try to execute python script I
see the following:
$ oowriter2 push_me_python4.odt 
'import site' failed; use -v for traceback

I fixed it by adding the line
delete $ENV{'PYTHONPATH'};
into
/usr/bin/ooffice2

before
# And here we go.
exec "$SystemInstallDir/program/soffice", @ooo_argv

------- Comment #1 From Andrey 2006-02-24 10:09:29 0000 -------
Created an attachment (id=80608) [details]
Diff for ooffice2

------- Comment #2 From Andrey 2006-02-24 10:10:13 0000 -------
Created an attachment (id=80609) [details]
Diff to create a python-core link 

------- Comment #3 From Andrey 2006-02-24 14:04:50 0000 -------
(From update of attachment 80609 [details])
--- /usr/portage/app-office/openoffice-bin/openoffice-bin-2.0.2_rc2.ebuild     
2006-02-21 05:35:51.000000000 -0500
+++ openoffice-bin-2.0.2_rc2.ebuild     2006-02-24 17:02:51.000000000 -0500
@@ -169,6 +169,7 @@
        done

        dosym ${INSTDIR}/program/spadmin.bin /usr/bin/oopadmin2
+       dosym ${INSTDIR}/program/python-core-2.3.4
${INSTDIR}/program/python-core

        # Change user install dir
        sed -i -e s/.openoffice.org2/.ooo-2.0/g
${D}${INSTDIR}/program/bootstraprc || die

------- Comment #4 From Andrey 2006-02-24 14:09:38 0000 -------
Created an attachment (id=80628) [details]
Diff for ooffice2

------- Comment #5 From Andrey 2006-02-24 14:11:14 0000 -------
Created an attachment (id=80629) [details]
Patch to create a python-core link

------- Comment #6 From Andreas Proschofsky 2006-03-04 08:04:12 0000 -------
Good catch, but I've only added the second patch (the one for the wrapper) to
our package, cause I can't reproduce the first one, it works fine for me
without the symlink. Maybe this was a temporary problem in RC2, please try if
rc4 works now for you

------- Comment #7 From Andrey 2006-03-04 10:22:42 0000 -------
I tested RC4 and it works right out of a box, I mean after emerge
openoffice-bin.
Thanks.

------- Comment #8 From Andreas Proschofsky 2006-03-04 11:05:42 0000 -------
Great and thanks for catching this!