Issue 92413

Summary: Upgrade python 2.3.4->2.6.1
Product: App Dev Reporter: iop <invalid>
Component: scriptingAssignee: joergbudi
Status: CLOSED FIXED QA Contact: Unknown <non-migrated>
Severity: Trivial    
Priority: P3 CC: arbraini, doko, eric.bachard, ingo.schmidt-rosbiegal, issues, liujiaxiang, mdxonefour, nesshof, rene, stephan.bergmann.secondary, tonal
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on: 100345, 100492, 101079, 101080    
Issue Blocks: 101106, 101213    

Description iop 2008-08-03 17:50:15 UTC
The installer of OOo 3 should have the newest Python build (2.5.2) included.
Comment 1 Olaf Felka 2008-08-04 10:52:52 UTC
@ jbu: Is this something for you?
Comment 2 iop 2008-08-04 13:07:51 UTC
Sorry? I don't understand.

I've just noticed, that the version, which is currently included in OOo 3.0 Beta
2 is simply outdated.
Comment 3 Olaf Felka 2008-08-04 13:41:10 UTC
What is it that you don't understand? As you can see in
http://wiki.services.openoffice.org/wiki/OOoRelease30 we have had code freeze
for OOo3. So this is targeted for the next release.
Comment 4 iop 2008-08-04 13:51:30 UTC
"@ jbu: Is this something for you?"

That is, what I don't understand :)

"As you can see in
http://wiki.services.openoffice.org/wiki/OOoRelease30 we have had code freeze
for OOo3. So this is targeted for the next release."

That means, that it is already planned?
Comment 5 Olaf Felka 2008-08-04 14:04:44 UTC
'jbu' is the abbreviation of the username of the developer who has brought
python to OOo. AFAIK in it not planned yet.
Comment 6 iop 2008-08-04 18:30:27 UTC
Oh, I see, ...
Would it make sense to write him a personnel message?
Comment 7 frey_1 2008-08-13 02:54:55 UTC
I need this too, because some improvements of the newest version are very useful
and I don't want to have Python installed twice on my system.

I don't think, that it would be that expensive simply to include the newest
Python build into the installer. Or am I wrong and there are also a few
compatibility tasks to do?
Comment 8 joergbudi 2008-08-13 19:28:21 UTC
Hi,

unfortunately, it is too much work for me atm. 

This is  a very platform dependent task, because every platform needs a special
set of patches, which must be reapplied to the new python version, so the one
doing the job needs to communicate a lot with other community members to get
this done.

I flag this issue as later, as I currently can't say when this issue is started. 

Bye,

Joerg
Comment 9 frey_1 2008-08-13 19:48:25 UTC
Hello and thanks for your response!

That's no problem.
The important thing is, that it will be done at some point.
When is secondary for now. :)
Comment 10 brendel 2009-01-30 09:16:00 UTC
I just want to add that this is also a problem for Bibus, a bibliography
programm that works together with OOO. The newer versions of Bibus work with
Python 2.5 and these cannot be used with OOO
Comment 11 rene 2009-02-13 12:13:45 UTC
jbu: please note
http://svn.gnome.org/viewvc/ooo-build/trunk/patches/dev300/pyuno-python-2.6-uno-import.diff?revision=14748&view=markup
(which afais is needed for python 2.6).

But you either need to make this conditional of also change configure.in to
require python >= 2.6
Comment 12 arbraini 2009-02-26 17:58:08 UTC
Where can I find the new patch that needs to be QA and approved?
Comment 13 rene 2009-03-06 12:26:23 UTC
arbraini: there is none... Even if there was, it'd not be completely representable
with a diff :-)

jbu: any status on this? I see a python26 cws created but that afair didn't get
any commits yet and you didn't reply to my hint for an additional patch needed.

(and why is this issue still on RESOLVED - LATER when there's a cws with this
cws assigned in "new", isn't it STARTED then?)
Comment 14 rene 2009-03-06 12:27:10 UTC
.
Comment 15 rene 2009-03-06 13:11:32 UTC
jbu: I felt free to commit the AM_PATH_PYTHON([2.2]) -> AM_PATH_PYTHON([2.6])
and the diff from the link I posted into the python26 cws...
Comment 16 rene 2009-03-06 13:12:40 UTC
.
Comment 17 eric.bachard 2009-03-12 17:15:58 UTC
+me on CC

@jbu : as I wrote you, I'll test on Mac OS X what has to be done, and if I can, I'll provide patches and/or 
help

Comment 18 joergbudi 2009-03-18 21:45:39 UTC
(this is sent additionally sent to dev@porting.openoffice.org)

Hi,

the cws python26 (based on DEV300_m41) shall upgrade the python engine from
2.3.4->2.6.1.

In its current state, it builds on linux-x86+win32-xp(with VC++ 9.0 
Express Edition).

I would welcome any porter to support the effort for the other platforms.

Up to now, Eric Bachard aleady agreed to take care for the macos-x port. 

Find below a small description, what needs to be done.

Bye,

Joerg
-----------

what needs to be done:
* checkout python26 cws
* configure ( PYTHONHOME env variable is removed from set_soenv.in)
* in case you reuse a dev300_m41 original build, ensure, that all python stuff
is erased from solver (python.exe, inc/python, lib/python, etc.) otherwise you
will get strange errors
* build the cws. You will probably get problems during building the python
module. Solve them.
* after that, build the rest (you may get additional problems in the pyuno
module, solve them)
* QA-1: 
build the testtools module and switch to testtools/source/bridgetest/pyuno and run

dmake runtest

* QA-2:
install the office, start python from the program directory and type 

import uno

* QA-3:
Start the office, choose Tools/Macros/Run macro ..., click on "OpenOffice.org
Macros", you should then have a pythonSamples Library at the bottom of the list. 

That's it. In case you have any problems you can't solve, let us know either on
this list or within the above issue. Attach patches to the above issue.



Comment 19 eric.bachard 2009-03-18 22:15:33 UTC
@jbu : thanks for the instructions : I'm checkout out the cws and I'll start.  

I'm so sorry for the delay, but I'm awfully busy with my day job these times :/
Comment 20 Stephan Bergmann 2009-04-17 09:37:02 UTC
Fixes for Solaris (unxsoli4.pro, unxsols4.pro, at least with Hamburg setsolar
environment) committed:

cws/python26/python/Python-2.6.1.patch@270927:
- declaring gethostname in pyport.h is not necessary at least on Solaris 10,
conflicts with the declaration in unistd.h (second arg. int vs. size_t), and
would hence break the build in pyuno
- copied the configure BLDLIBRARY stuff from Python-2.3.4.patch (other
Solaris-specific changes in Python-2.3.4.patch appear to no longer be necessary)

cws/python26/python/makefile.mk@270927:
- -xc99=all appears to no longer be necessary, but instead would now break the build

cws/python26/testtools/source/bridgetest/pyuno/makefile.mk@270927:
- necessary adaptions for USE_SHELL=bash

QA-2 and QA-3 (<#desc19>) work fine.  However, QA-1 fails for me with

---8<---
cd ../../../unxsoli4.pro/lib && export
FOO=file:///home/sb/python26/DEV300/ooo/testtools/source/bridgetest/pyuno/../../../unxsoli4.pro/lib
    UNO_TYPES=pyuno_regcomp.rdb UNO_SERVICES=pyuno_regcomp.rdb && python main.py
Traceback (most recent call last):
  File "main.py", line 31, in <module>
    import uno
ImportError: No module named uno
dmake:  Error code 1, while making 'runtest'
---8<---
Comment 21 hjs 2009-04-17 14:33:47 UTC
unxlngi6.pro (gcc 3.4.1) builds and survives QA-2 and QA-3. QA-1 breaks with the
error mentioned by sb.
committed some small pyuno changes regarding PyTypeObject initialisation from
DEV300 (new member 2.3->2.6) to remove gcc warnings.
Comment 22 joergbudi 2009-04-19 22:16:01 UTC
@hjs,sb:about the qa-1-check, your PYTHONPATH environment variable should
contain a .../solver/300/unxsoli4.pro/lib/pyuno directory, which should contain
a uno.py (which has been delivered before from pyuno module). Please check this
 ... 
Comment 23 Stephan Bergmann 2009-04-20 09:32:18 UTC
@jbu:  indeed,

$ cd $SRC_ROOT/testtools/source/bridgetest/pyuno &&
PYTHONPATH=${PYTHONPATH+${PYTHONPATH}:}$SOLARVERSION/$INPATH/lib$UPDMINOREXT:$SOLARVERSION/$INPATH/lib$UPDMINOREXT/pyuno:.
dmake runtest

makes QA-1 pass for me (where PYTHONPATH was originally unset)
Comment 24 Stephan Bergmann 2009-04-21 16:01:48 UTC
the PYTHONPATH fiddling I described in <#desc24> is due to issue 101213
Comment 25 Martin Hollmichel 2009-04-22 07:53:55 UTC
set target 3.1
Comment 26 Martin Hollmichel 2009-04-22 13:54:18 UTC
@joerg: any work left to do for the upgrade, I suggest to mark issue now as fixed.
Comment 27 mdxonefour 2011-04-11 08:02:07 UTC
*** Issue 71327 has been marked as a duplicate of this issue. ***