Libreoffice 'exceptions.ImportError object has no attribute 'with_traceback'"

Bug #1222823 reported by cpina
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
LibreOffice
Invalid
Undecided
Unassigned
libreoffice (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

This happens here in an Ubuntu 12.04 32 bit. It may happen to other versions but I haven't tried yet.

When using Libreoffice 1:4.1.1-0ubuntu1~precise1 (Help - About LibreOffice shows Version: 4.1.1.2, Build ID: 410m0(Build:2) installed using the PPA libreoffice-4.1: when adding the attached extension it shows an error message such as:
-------------
<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/copy.py:60 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/decimal.py:139 in function <module>() [import copy as _copy]
  /usr/lib/python2.7/dist-packages/uno.py:268 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]
  /usr/lib/python2.7/dist-packages/simplejson/__init__.py:109 in function <module>() [from decimal import Decimal]
  /usr/lib/python2.7/dist-packages/uno.py:268 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]
  /home/carles/.config/libreoffice/4/user/uno_packages/cache/uno_packages/lumd3lp.tmp_/Mendeley-1.10-dev3.oxt/Scripts/MendeleyDesktopAPI.py:17 in function <module>() [try: import simplejson as json]
  /usr/lib/libreoffice/program/pythonloader.py:103 in function getModuleFromUrl() [exec(codeobject, mod.__dict__)]
  /usr/lib/libreoffice/program/pythonloader.py:149 in function writeRegistryInfo() [mod = self.getModuleFromUrl( locationUrl )]
-------------

Using Libreoffice 4.1 from libreoffice.org: works correctly.

Editing the extension with this change:
-except ImportError: import json
+except: import json

(it appears twice)

Then it works correctly - not sure why.

Let me know if you need some more information.

Thank you,

Tags: ppa
Revision history for this message
cpina (carles-pina) wrote :
penalvch (penalvch)
Changed in libreoffice (Ubuntu):
status: New → Invalid
Revision history for this message
cpina (carles-pina) wrote :

Hello,

I reported it here because I asked the Libreoffice PPA maintainers and they referred to me to do it here. They also pointed me out to:

https://lists.launchpad.net/libreoffice/msg00072.html

I used the tag as mentioned.

If I should use another place let me know. I tried to use: https://bugs.launchpad.net/~libreoffice but I can't open a ticket there (no link or button to open tickets). Hence I asked them and they said to me to do it here.

I changed the status again to New - feel free to change back to whatever makes sense for your process.

Regards,

Carles

Revision history for this message
Björn Michaelsen (bjoern-michaelsen) wrote :

It seems to me to be a upstream bug too, but you likely use python3 there. Install python3-uno instead of python-uno.

penalvch (penalvch)
affects: libreoffice (Ubuntu) → df-libreoffice
Changed in df-libreoffice:
status: Invalid → New
Revision history for this message
cpina (carles-pina) wrote :

Hi Björn,
I tried it yesterday. All my python3-uno available packages (checked with apt-cache show python3-uno) depends on libreoffice 3.

sudo apt-get install python3-uno returns:
"python3-uno : Depends : libreoffice-core (= 1:3.5.7-0ubuntu4) but 1:4.1.1-0ubuntu1~precise1 is to be installed".

I agree that seems that it's some python3/python2 problem. I haven't been able to reproduce using upstream though.

Revision history for this message
Björn Michaelsen (bjoern-michaelsen) wrote :

Oh, indeed: The precise backport seems to have only python-uno, not python3-uno. Subscribing ricotz, who is doing the backport -- maybe he has a simple solution.

penalvch (penalvch)
affects: openlp → libreoffice (Ubuntu)
Revision history for this message
penalvch (penalvch) wrote :

Zachary Steele, please do not add bug tasks to this report.

Changed in df-libreoffice:
status: New → Invalid
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

@cpina: Libreoffice 4.1+ requires python 3.3 which isn't available on Precise/12.04. Therefore it isn't possible to provide the python3 bindings. So it is needed that plugins are python2 compatible to work.
@bjoern: Feel free to correct me.

Revision history for this message
Björn Michaelsen (bjoern-michaelsen) wrote :

Gnah, indeed. LibreOffice 4.1 can talk via UNO to Python 3, but only 3.3 or above, or Python2. However, internally LibreOffice 4.1 uses Python 3.3 anyway (so I assume some things are broken on the precise backport, e.g. File->Wizards -- the only way around that would be to ship LibreOffice 4.1 with Python 3.3, possibly as an internal copy). So this is essentially a loose-loose situation (unless you update to Ubuntu Raring or Saucy), sorry.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libreoffice (Ubuntu):
status: New → Confirmed
Revision history for this message
Giaosudau (giaosudau) wrote :

How to fix this problem?

Revision history for this message
Giaosudau (giaosudau) wrote :

I found the way to fix this problem
Just replace this file below to /usr/lib/python2.7/dist-packages/uno.py
then It work Ok again.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in libreoffice (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for libreoffice (Ubuntu) because there has been no activity for 60 days.]

Changed in libreoffice (Ubuntu):
status: Incomplete → Expired
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.