Issue 71327

Summary: update to python 2.5
Product: udk Reporter: liujiaxiang
Component: codeAssignee: liyuan <eliyuan>
Status: CLOSED DUPLICATE QA Contact:
Severity: Trivial    
Priority: P3 CC: clytie, darabos.daniel, issues, josh, lohmaier, maison.godard, mdxonefour, pagalmes.lists, thb, tiago, tonal
Version: OOo 2.0.4   
Target Milestone: 4.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 72764, 93084    

Description liujiaxiang 2006-11-08 07:54:45 UTC
update to python 2.5
Comment 1 maison.godard 2006-11-08 08:04:48 UTC
changing parameters
Comment 2 maison.godard 2007-02-03 09:58:57 UTC
cws python25
Comment 3 liyuan 2007-03-01 01:59:46 UTC
 reassign to pj
Comment 4 peter.junge 2007-03-01 06:25:33 UTC
Hi,
I send the issue back to development (Liyuan), CWS python25 is not ready yet.
(BTW, is Liutao still a member of this project?)

Please review for general CWS process:
http://wiki.services.openoffice.org/wiki/CWS
... and for QA CWS approval:
http://wiki.services.openoffice.org/wiki/Approve_a_CWS
and some of the links within these documents.

Peter
Comment 5 liujiaxiang 2007-03-01 08:53:09 UTC
yes,I am still a member of this project.
Comment 6 lohmaier 2007-04-11 13:56:35 UTC
That cws will break building with system python because of
http://go-oo.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=framework/scripting/source/pyprov&command=DIFF_FRAMESET&file=mailmerge.py&rev1=1.2&rev2=1.2.44.3&root=/var/cvsup

scripting/source/pyprov/mailmerge.py:

- from email.MIMEBase import MIMEBase                                             
+ from email.mime.base import MIMEBase                                            

This changed import causes the packaging to fail:
register component 'vnd.openoffice.pymodule:mailmerge' in registry
'/Users/buildslave/compile/shadow/instsetoo_native/unxmacxp.pro/OpenOffice//services.rdb/en-US_inprogress_1/services.rdb'
failed!
error (RuntimeException): Couldn't load vnd.openoffice.pymodule:mailmerge for
reason type email.mime.base.MIMEBase is unknown
Comment 7 lohmaier 2007-04-11 14:06:43 UTC
from http://www.python.org/download/releases/2.5/NEWS.txt
- email 4.0 package now integrated.  This is largely the same as the email 3.0
  package that was included in Python 2.3, except that PEP 8 module names are
  now used (e.g. mail.message instead of email.Message).  The MIME classes
  have been moved to a subpackage (e.g. email.mime.text instead of
  email.MIMEText).  The old names are still supported for now.  Several
  deprecated Message methods have been removed and lots of bugs have been
  fixed.  More details can be found in the email package documentation.

"The old names are still supported for now"

So please revert that import and add a "deprecated - since python 2.5 other
package-name" style comment.
Comment 8 liyuan 2007-04-12 06:31:16 UTC
I have updated the file,
scripting/source/pyprov/mailmerge.py:

+#if defined(MAC) || defined(MACOSX)
+from email.MIMEBase import MIMEBase
+#else                                        
from email.mime.base import MIMEBase                                            
+#endif

http://go-oo.org/bonsai/cvsview2.cgi?
diff_mode=context&whitespace_mode=show&root=/var/cvsup&subdir=framework/scriptin
g/source/pyprov&command=DIFF_FRAMESET&root=/var/cvsup&file=mailmerge.py&rev1=1.2
.44.4&rev2=1.2.44.5

Is it effective ?
Comment 9 maison.godard 2007-04-12 08:36:07 UTC
it is not the simplest way as the problem is on python version and not the platform.
some linux-distro-build use other python version we do not know

perharps use the still supported but deprecated import declaration 
deprecation is made for this : backward compatibility
Comment 10 lohmaier 2007-04-12 09:20:04 UTC
I did not check, but I'd be surprised if you could use c-style #if statements in
python code.. But even if that statement would do what is intended, then this
still would only work for Mac, not for linux or other platforms.

Since python 2.5 still supports the old names, and the version that OOo will
ship will not change every month, using the old name is much better solution.

The new name should only be changed once: 
* OOo switches to an internal python that doesn't support the old names anymore
or
* All linux distributions (including stable debian, etc...) switched to python
2.5 for a long time. (this could take a while...)

Besides that, ifdefing for a platform should really be avoided if its not really
necessary (IMHO)

So if there is no compelling reason to insist on the new name, please use the
old name and add a deprecation hint.

An alternative solution (but way to complicated for this one) is to check for
the python version that is used for compiling OOo. But still I prefer to just
use the old name until it won't work anymore for OOo.
Comment 11 liyuan 2007-04-12 10:29:28 UTC
:-( , Sorry ,  I treated the python file as a C file. 

#python2.5: from email.mime.base import MIMEBase
from email.MIMEBase import MIMEBase 
Comment 12 lohmaier 2007-04-15 13:53:37 UTC
the current version works wor both system and internal python. Thanks.
Comment 13 liyuan 2007-04-16 09:53:32 UTC
Thank you very much, Cloph
The CWS python25 has been built successfully on Mac OSX gcc-4.0.1(X11) and 
linux-gcc-4.0.2(sun-java).
http://go-oo.org/tinderbox/python25/status.html
Comment 14 liujiaxiang 2007-07-13 07:32:26 UTC
fixed just for test
Comment 15 liujiaxiang 2007-07-13 07:47:02 UTC
sorry for test
Comment 16 ingenstans 2008-03-17 11:39:10 UTC
Did this ever get integrated? Will it? 
Comment 17 rene_leonhardt 2008-07-28 16:58:51 UTC
Will Python 2.5.2 be included at least in OOo 2.4.2 and 3.0?
Please be aware that Python 2.6 and 3.0 will be finished in September.
Comment 18 clytie 2008-09-13 13:11:41 UTC
Our OpenOffice.org 3.0 Vietnamese release will depend heavily upon an extension converting pre-
Unicode to Unicode files in our language. This is a major takeup factor for us. It relies on Python. Please, 
what is the status of this issue? 
Comment 19 odd_bloke 2008-09-16 11:38:42 UTC
I too am interested in seeing this go in.  Can someone in the know please give
us a status update?
Comment 20 liujiaxiang 2008-09-17 05:39:35 UTC
the code have been resynced by me and the tag is DEV300_m30
but there are some issues(or conflics).
eric.bachard told me he will help me to solve that issues.
I think he is doing this now.
Comment 21 rene_leonhardt 2008-09-21 12:22:36 UTC
This issue is not listed in the 3.0 RC2 release notes:
http://development.openoffice.org/releases/3.0.0rc2.html

I hope it will be integrated before the next release candidate.
Comment 22 joshuapk 2008-10-10 15:37:25 UTC
Is there any hope of seeing this in 3.0, or do we have to wait for 3.1?  I have
a project that needs Python > 2.3 on all platforms.  How can we help?
Comment 23 rene_leonhardt 2008-10-10 19:32:56 UTC
OpenOffice.org 3.0.0 has been uploaded on Oct 6th and published yesterday (at
least for en-US), the newest files it contains are from September.
It still contains python23.dll (2.3.4150.1012) like OpenOffice.org 2.4.1.
It seems 2 years are still not enough to update on time for the new major release.
Let's hope the patch created 23 days ago will be reviewed in the next months...
Comment 24 tonal 2008-12-16 04:44:52 UTC
Maybe python 2.6 better?
Comment 25 brendel 2009-01-30 09:18:18 UTC
This problem is also discussed in issue 92413

Oliver
Comment 26 jmichae3 2009-12-31 00:52:45 UTC
I don't want python in OOo. use some other scripting language.
Comment 27 mdxonefour 2011-04-11 08:02:07 UTC
To me this issue sounds somehow duplicate to issue 92413

*** This issue has been marked as a duplicate of issue 92413 ***