Bug 69070

Summary: with_traceback is python 3.x only
Product: LibreOffice Reporter: eburghar
Component: sdkAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: blocker CC: jorendc
Priority: medium    
Version: 4.1.2.1 rc   
Hardware: All   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:

Description eburghar 2013-09-07 14:54:13 UTC
I have installed python-uno package for ubuntu 13.04. My python extension are not working anymore. This is the traceback

ERROR: <type 'exceptions.AttributeError'>: 'exceptions.ImportError' object has no attribute 'with_traceback', traceback follows
  /usr/lib/python2.7/dist-packages/uno.py:334 in function _uno_import() ["%s (or '%s.%s' is unknown)" % (py_import_exc, name, x)]
  /usr/lib/python2.7/pickle.py:88 in function <module>() [from org.python.core import PyStringMap]
  /usr/lib/python2.7/dist-packages/uno.py:268 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]
  /usr/lib/python2.7/subprocess.py:432 in function <module>() [import pickle]
  /usr/lib/python2.7/dist-packages/uno.py:268 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]

The problem is line 334 of uno.py which use the with_traceback method which is for python 3.x only. Removing it solves my problem.

Regards.
Comment 1 Jorendc 2013-09-08 08:41:55 UTC
I'm not a developer at all, but I know we changed to Python version 3.2 bundled into LibreOffice. Please see https://wiki.documentfoundation.org/ReleaseNotes/4.0#Python and link http://python3porting.com/

I hope this is rather an answer to your question then a bug in LibreOffice?

Kind regards,
Joren
Comment 2 eburghar 2013-09-08 13:03:58 UTC
Well think this is a packaging problem though.

On linux flavor, libreoffice is generally using the system python interpreter and not the bundled one. On ubuntu (debian ?) you have python-openoffice that depends on python3-uno or python-uno. The problem is that python-uno uses python3 with_traceback.

Anyway I ported my python extension to python3 as it is the future and the default for osx and windows. Extensions should be os agnostic, shouldn't they ?

Thanks for the reply.
Comment 3 Jorendc 2013-09-08 13:06:34 UTC
Good questions :), but I'm not a developer. I think emailing the developer mailinglist will result in a better answer. http://lists.freedesktop.org/mailman/listinfo/libreoffice

Kind regards,
Joren