Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#1736 closed defect (fixed)

getting it to work under Python 2.5

Reported by: rdeman Owned by: cdevienne
Priority: high Component: PageToOdtPlugin
Severity: blocker Keywords: python 2.5
Cc: Trac Release: 0.10


First my plugin did not work at all (it did not show uo in WebAdmin -> Plugins) Then I figured that b/c I am using Python 2.5 I need to change the import statement si replaced in

#import cElementTree as ElementTree


from xml.etree.ElementTree import Element, ElementTree # python 2.5

note that I am a total Python newbie... at least the plugin shows up in the WebAdmin -> Plugins menu now and it is activated... .but now I have the same problem as described above.

But now I get this error:

Python Traceback

Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/trac/web/", line 387, in dispatch_request
  File "/var/lib/python-support/python2.5/trac/web/", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/var/lib/python-support/python2.5/trac/wiki/", line 134, in process_request
    page.text, format,
  File "/var/lib/python-support/python2.5/trac/mimeview/", line 604, in send_converted
    content, selector)
  File "/var/lib/python-support/python2.5/trac/mimeview/", line 384, in convert_content
    output = converter.convert_content(req, mimetype, content, ck)
  File "build/bdist.linux-i686/egg/pagetoodt/", line 30, in convert_content
    archive = zipfile.ZipFile(self.template_filename, 'r')
  File "", line 339, in __init__
    self.fp = open(file, modeDict[mode])
IOError: [Errno 2] No such file or directory: u'/var/www/trac/pwc/attachments/wiki/PageToOdtStyles/empty.odt'

Attachments (0)

Change History (5)

comment:1 Changed 10 years ago by rdeman

  • Resolution set to fixed
  • Status changed from new to closed

here is the fix (tested and verified) to get the plugin working with Python 2.5

replace in

import cElementTree as ElementTree


	# python 2.5 way of life :)
	import xml.etree.cElementTree as ElementTree
	# python 2.4
	import cElementTree as ElementTree 

Don't forget to

now it should work

comment:2 Changed 9 years ago by JasonWinnebeck

  • Resolution fixed deleted
  • Status changed from closed to reopened

This didn't actually appear to be checked in?

comment:3 Changed 9 years ago by cdevienne

  • Resolution set to fixed
  • Status changed from reopened to closed

Applied in r2650.

Thanks for the patch and sorry for the delay.

comment:4 Changed 9 years ago by anonymous

If this makes the plugin stable and work on 0.11, let's add the 0.11 tag to the plugin page to advertise 0.11 support.

comment:5 Changed 9 years ago by JasonWinnebeck

Wow, wrong ticket, sorry I was really off in another world on that one. This ticket is adding Python 2.5 support.

Add Comment

Modify Ticket

as closed The owner will remain cdevienne.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.