[5.0] Critical regression on 5.0.13 release, current_thread() doesn't exist in python2.5

Bug #629619 reported by Omar (Pexego)
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

In last release of OpenERP server (5.0.13 release), a regression was introduced on this statement of sql_db.py: "from threading import current_thread" also on netsvc.py statement "threading.current_thread()". This class name does not exist in python2.4, python2.5 and first revisions of python2.6! (In the newer versions it is an alias for currentThread).

current_thread should be replaced by "currentThread" that works on python2.4, python2.5, python2.6 and python2.7 at least (patch included).

Examples (Linux Mint 7; but tested on several machines [debian/ubuntu/mint]):

On Python 2.5 current_thread is not available:

$ python2.5
Python 2.5.4 (r254:67916, Jan 20 2010, 21:44:03)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from threading import current_thread
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name current_thread
>>> from threading import currentThread
>>>

On Python 2.6 it is:

$ python2.6
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from threading import current_thread # New in 2.6
>>> from threading import currentThread # Also works (deprecated?)
>>>

Revision history for this message
Omar (Pexego) (omar7r) wrote :
Revision history for this message
Omar (Pexego) (omar7r) wrote :
description: updated
summary: - [5.0] Critical regression, current_thread() doesn't exist in python2.5
+ [5.0] Critical regression on 5.0.13 release, current_thread() doesn't
+ exist in python2.5
Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Will be fixed in 5.0.14 in few minutes.

Regards,

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Thanks Stephane :)

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

NB: worse: OpenERP v5.x isn't very 2.6 friendly either as it doesn't raise exceptions properly in 2.6 (couldn't remember, but basically Sharron Thomas proposed some fixes a while ago, his branch has been rejected under the pretext that 2.6 had to be frozen). So it works with 2.6 but has some issues as soon as you have exceptions, like if you try to develop modules. So I hope it get 2.4 / 2.5 compatible again...

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Raphael,

This patch has not been tested with Python 2.5.

I will try to implement tox with buildbot to avoid this kind of error.

Now, it's fixed with the patch of Omar.

Thank you,

Stéphane

Changed in openobject-server:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.