Bug 105227

Summary: OpenOffice.org pyuno bridge is not usable on x86_64
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Petr Mladek <pmladek>
Component: OpenOffice.orgAssignee: Petr Mladek <pmladek>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Beta 1   
Target Milestone: ---   
Hardware: x86-64   
OS: SUSE Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Full strace.log (bzipped)

Description Petr Mladek 2005-08-17 15:09:25 UTC
I tested the mail merge feature in OOo and was not able to send the documents
via e-mail. This part is implemented in Python and uses the pyuno bridge to
communicate with OOo. The bridge is compiled agaist the system Python. The
entire package OOo is built on ix86, so the bridge is linked against 32bit Python.

The python-32bit package includes just the .so libraries. The applications tries
to find the python native files (.py, .pyc, ...) in /usr/lib/python. But the
files are not there.

Here is a snippet from the strace.log that shows the problem:
--- cut ---
10567 14:43:32.650843 open("/usr/lib/python2.4/lib-dynload/site.so",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
10567 14:43:32.651449 open("/usr/lib/python2.4/lib-dynload/sitemodule.so",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or dire
ctory)
10567 14:43:32.652093 open("/usr/lib/python2.4/lib-dynload/site.py",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
10567 14:43:32.652710 open("/usr/lib/python2.4/lib-dynload/site.pyc",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory
)
10567 14:43:32.653327 futex(0x81e93a0, FUTEX_WAKE, 1) = 0
10567 14:43:32.653842 write(2, "\'import site\' failed; use -v for traceback\n",
43) = 43
--- cut ---

I'll attach the full strace.log.

The problem was solved after I copied all files under /usr/lib/python2.4 from
the package python-2.4.1-*.i586.rpm. So, probably more files from
/usr/lib/python2.4 should be added the the python-32bit package.


Steps to reproduce the bug:
1. Start oowriter
2. Select Tools->Options...->Mail Merge E-mail
3. Configure your (SMTP) settings
4. Press the button "Test Settings..."

The test fails and the wrapper oowriter prints something like:
--- cut ---
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
--- cut ---

If you want to get the strace log, you must do the following steps:
1. cd /usr/lib/ooo-2.0/program
2. run strace32 -f -tt -o ~/strace.log -s 1024 ./soffice.bin
3. Select File->New->Text Document
4. and continue with the 2. step from the steps to reproduce the bug
Comment 1 Petr Mladek 2005-08-17 15:11:10 UTC
Created attachment 46329 [details]
Full strace.log (bzipped)
Comment 2 Olaf Hering 2005-08-19 07:40:54 UTC
it needs things like 

/usr/lib/python2.4/site.pyc
/usr/lib/python2.4/warnings.pyc
/usr/lib/python2.4/encodings.pyc
/usr/lib/python2.4/os.pyc
/usr/lib/python2.4/traceback.pyc

I guess I have to add \.pyc$ to the pattern...
Comment 3 Olaf Hering 2005-08-19 08:02:17 UTC
can you check if setting PYTHONPATH= to something will fix it as well?

PYTHONPATH=/usr/lib64/python/ python -c 'import sys; print sys.path'
Comment 4 Petr Mladek 2005-08-22 16:31:54 UTC
Great, it started to work after I updated
/usr/lib/ooo-2.0/program/pythonloader.unorc from:

--- cut ---
[Bootstrap]
PYTHONPATH=$ORIGIN
--- cut ---

to

--- cut ---
[Bootstrap]
PYTHONPATH=$ORIGIN file:///usr/lib/python2.4/lib-dynload 
file:///usr/lib/python2.4/site-packages file:///usr/lib64/python
file:///usr/lib/python24.zip file:///usr/lib64/python2.4
file:///usr/lib64/python2.4/plat-linux2 file:///usr/lib64/python2.4/lib-tk
file:///usr/lib64/python2.4/lib-dynload 
file:///usr/lib64/python2.4/site-packages
file:///usr/lib64/python2.4/site-packages/Numeric
file:///usr/lib64/python2.4/site-packages/PIL
file:///usr/lib64/python2.4/site-packages/gtk-2.0
PYTHONHOME=file:///usr/lib/python2.4
--- cut ---

The PYTHONPATH includes the original $ORIGIN + 
the two paths from python-32bit +
the paths printed by `PYTHONPATH=/usr/lib64/python/ python -c 'import sys; print
sys.path'` converted to URL format

OK, I'll update the pythonloader.unorc in the %post script when the package is
installed on x86_64 architecture.
Comment 5 Petr Mladek 2005-08-25 15:29:09 UTC
The pythonloader.unorc is updated on x86_64 architecture. I used a trigger in
the OOo package. It does the action when the python package is installed. It
should work even if we update the python version.

The fix should be available on SL 10.0-beta4.