unable to run pootle, possible problem with python 2.4 → 2.5 upgrade

Bug #83639 reported by Stefano Costa
10
Affects Status Importance Assigned to Milestone
pootle (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: pootle

sudo PootleServer
/var/lib/python-support/python2.5/jToolkit/data/dates.py:27: DeprecationWarning: The sre module is deprecated, please import re.
  import sre
Traceback (most recent call last):
  File "/usr/sbin/PootleServer", line 23, in <module>
    from Pootle import pootle
  File "/usr/lib/python2.5/site-packages/Pootle/pootle.py", line 23, in <module>
    from jToolkit.web import templateserver
  File "/var/lib/python-support/python2.5/jToolkit/web/templateserver.py", line 26, in <module>
    import kid
  File "/var/lib/python-support/python2.5/kid/__init__.py", line 30, in <module>
    from kid.codewriter import KID_XMLNS
  File "/var/lib/python-support/python2.5/kid/codewriter.py", line 16, in <module>
    from kid.parser import *
  File "/var/lib/python-support/python2.5/kid/parser.py", line 9, in <module>
    from kid.et import * # ElementTree
AttributeError: 'module' object has no attribute 'ElementTree'

python-elementtree is installed.

In a python2.5 shell, the following import doesn't succeed:

steko@cycnus:/usr/share/pycentral/pootle/site-packages$ python
Python 2.5 (release25-maint, Feb 5 2007, 02:52:52)
[GCC 4.1.2 20070129 (prerelease) (Ubuntu 4.1.1-31ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from kid.et import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/lib/python-support/python2.5/kid/__init__.py", line 30, in <module>
    from kid.codewriter import KID_XMLNS
  File "/var/lib/python-support/python2.5/kid/codewriter.py", line 16, in <module>
    from kid.parser import *
  File "/var/lib/python-support/python2.5/kid/parser.py", line 9, in <module>
    from kid.et import * # ElementTree
AttributeError: 'module' object has no attribute 'ElementTree'
>>>

But it goes nice with python2.4:

steko@cycnus:/usr/share/pycentral/pootle/site-packages$ python2.4
Python 2.4.4 (#2, Feb 5 2007, 17:46:20)
[GCC 4.1.2 20070129 (prerelease) (Ubuntu 4.1.1-31ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from kid.et import *
>>>

So perhaps there is some problem with that. I hope that helps and I'm willful to provide more information about this bug

Revision history for this message
Dan O'Huiginn (daniel-ohuiginn) wrote :

I can reproduce this. No idea how to fix it, though

Changed in pootle:
status: Unconfirmed → Confirmed
Revision history for this message
Dan O'Huiginn (daniel-ohuiginn) wrote :

Right. Having investigated further, there are two problems. They're both caused by the python module elementtree being moved between python2.4 and python2.5:

1) The package python-kid in edgy doesn't work well with python2.5, because the location of elementtree has been moved. This is what you're seeing here
2) pootle itself also tries to import elementtree. This hasn't been fixed, and is the problem I was seeing when I tried to reproduce it

I'm going to look into fixing (2). I'll also try to contact upstream about what else is likely to break with python2.5 - it looks like they've been coding for 2.4 and previous.

Changed in pootle:
assignee: nobody → daniel-ohuiginn
importance: Undecided → Medium
status: Confirmed → In Progress
Revision history for this message
Dan O'Huiginn (daniel-ohuiginn) wrote :

submitted a patch upstream at http://bugs.wordforge.org/show_bug.cgi?id=236; I'm too lazy to go through all the faff of adding an upstream link in launchpad.

Revision history for this message
helix84 (helix84) wrote :

I reported this same issue at the pootle-translate mailing list and it was solved and it will get patched.

http://www.nabble.com/Pootle-%40-Ubuntu-Gutsy-not-working-td14668296.html

Changed in pootle:
assignee: daniel-ohuiginn → nobody
Revision history for this message
helix84 (helix84) wrote :

fixed in upstream; fix released in ubuntu

Changed in pootle:
status: In Progress → Fix Released
Revision history for this message
Dani (damufo) wrote :

Hello:
I have this bug in ubuntu 8.10 final.

damufo@trebello:~$ PootleServer
/var/lib/python-support/python2.5/jToolkit/data/dates.py:27: DeprecationWarning: The sre module is deprecated, please import re.
  import sre
Python-Levenshtein not found. Continuing with built-in (slower) fuzzy matching.
2008-11-01 12:16:57: Listening on port 8080
2008-11-01 12:16:57: To use the server, open a web browser at http://127.0.0.1:8080/
2008-11-01 12:16:57: Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/jToolkit/web/simplewebserver.py", line 613, in getserver
    server = getserverwithprefs(options.prefsfile, options.instance, httpd)
  File "/var/lib/python-support/python2.5/jToolkit/web/__init__.py", line 163, in getserverwithprefs
    raise IOError(errormessage)
IOError: Error using prefs file '/etc/pootle/pootle.prefs':
No such file

2008-11-01 12:16:57: Error initializing server, exiting: Error using prefs file '/etc/pootle/pootle.prefs':
No such file

Changed in pootle:
status: Fix Released → Fix Committed
status: Fix Committed → Confirmed
Revision history for this message
Dani (damufo) wrote :

Sorry with:
sudo PootleServer
work fine!

Changed in pootle:
status: Confirmed → 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.