Ticket #3029 (assigned defect)

Opened 3 months ago

Last modified 3 months ago

TracDownloader with TracTags problem?

Reported by: jyjourdain@j2s.net Assigned to: peca (accepted)
Priority: high Component: TracDownloaderPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description

I downloaded the code. I installed it using "python setup.py install" command. I thank all was fine but each time I connect to the trac home page I got the error :

Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/Trac-0.11rc1-py2.4.egg/trac/web/api.py", line 339, in send_error 'text/html') File "/usr/lib/python2.4/site-packages/Trac-0.11rc1-py2.4.egg/trac/web/chrome.py", line 684, in render_template data = self.populate_data(req, data) File "/usr/lib/python2.4/site-packages/Trac-0.11rc1-py2.4.egg/trac/web/chrome.py", line 592, in populate_data dchrome?.update(req.chrome) File "/usr/lib/python2.4/site-packages/Trac-0.11rc1-py2.4.egg/trac/web/api.py", line 168, in getattr value = self.callbacks[name](self) File "/usr/lib/python2.4/site-packages/Trac-0.11rc1-py2.4.egg/trac/util/compat.py", line 130, in newfunc return func_(*(args + fargs), **dict(kwargs, **fkwargs)) File "/usr/lib/python2.4/site-packages/Trac-0.11rc1-py2.4.egg/trac/web/chrome.py", line 460, in prepare_request for category, name, text in contributor.get_navigation_items(req): File "build/bdist.linux-i686/egg/tracdownloader/web_ui.py", line 53, in get_navigation_items LookupError?: unknown encoding: /projects/project/downloader

In fact, TracDownloader? was already installed. I got that error after the installation of TracTags. Is there a link?

I don't know python at all. What I can see is that the error is there:

def get_navigation_items(self, req):

"""Downloader isinstance visible if user hasattr got permission """ if req.perm.has_permission('DOWNLOADER_DOWNLOAD'):

yield 'mainnav', 'downloader', Markup('<a href="%s">Downloader</a>',

self.env.href.downloader())

I can confirm that because if I remove the DOWNLOADER_DOWNLOAD permission, that's better!

Any idea? Thanks.

Attachments

Change History

(in reply to: ↑ description ) 05/14/08 10:25:13 changed by jyjourdain@j2s.net

I'm talking about the plugin TagsPlugin. Sorry.

05/19/08 07:15:38 changed by kimus.linuxus@gmail.com

  • severity changed from normal to blocker.

got the same error without the TagsPlugin:

  File "build/bdist.linux-i686/egg/tracdownloader/web_ui.py", line 53, in get_navigation_items
    self.env.href.downloader())
LookupError: unknown encoding: /projectname/downloader

05/19/08 07:45:52 changed by coderanger

This is due to an API change with the Markup class between Trac 0.10 and Genshi (Trac 0.11). You need to use explicit interpolation now, or better yet use the genshi.builder.tag factory object.

(follow-up: ↓ 8 ) 05/19/08 07:52:48 changed by kimus.linuxus@gmail.com

fixed with this change:

Index: tracdownloader/web_ui.py
===================================================================
--- tracdownloader/web_ui.py	(revision 3694)
+++ tracdownloader/web_ui.py	(working copy)
@@ -17,6 +17,7 @@
 from trac.core import *
 from trac.perm import IPermissionRequestor
 from trac.util import Markup
+from trac.util.html import html
 from trac.wiki.api import IWikiSyntaxProvider
 from trac.web import IRequestHandler
 from trac.web.chrome import add_stylesheet, INavigationContributor, \
@@ -49,8 +50,9 @@
     def get_navigation_items(self, req):
         """Downloader isinstance visible if user hasattr got permission """
         if req.perm.has_permission('DOWNLOADER_DOWNLOAD'):
-            yield 'mainnav', 'downloader', Markup('<a href="%s">Downloader</a>',
-                                             self.env.href.downloader())
+	    yield 'mainnav', 'downloader', html.a('Downloader', href = req.href.downloader())
+            #yield 'mainnav', 'downloader', Markup('<a href="%s">Downloader</a>',
+            #                                 self.env.href.downloader())
 
     # IRequestHandler methods

05/19/08 10:00:54 changed by jyjourdain@j2s.net

Yes, that works, thanks! What I have to do? Do I have to close the ticket myself? Thanks again, kind regards.

05/19/08 10:14:54 changed by anonymous

NO, that was a workaround, the plugin team must implement whatever they want and close the ticket if and whenever they want.

05/20/08 01:56:33 changed by anonymous

OK, I understand. Thanks.

(in reply to: ↑ 4 ) 05/20/08 04:25:16 changed by peca

  • priority changed from normal to high.
  • status changed from new to assigned.

Hello,

thanks a lot for identifying this problem. I hope I will find some time to implement all fixes from tickets into downloader soon.

Have a nice day! Peca

Replying to kimus.linuxus@gmail.com:

fixed with this change: {{{ Index: tracdownloader/web_ui.py =================================================================== --- tracdownloader/web_ui.py (revision 3694) +++ tracdownloader/web_ui.py (working copy) @@ -17,6 +17,7 @@ from trac.core import * from trac.perm import IPermissionRequestor from trac.util import Markup +from trac.util.html import html from trac.wiki.api import IWikiSyntaxProvider from trac.web import IRequestHandler from trac.web.chrome import add_stylesheet, INavigationContributor, \ @@ -49,8 +50,9 @@ def get_navigation_items(self, req): """Downloader isinstance visible if user hasattr got permission """ if req.perm.has_permission('DOWNLOADER_DOWNLOAD'): - yield 'mainnav', 'downloader', Markup('<a href="%s">Downloader</a>', - self.env.href.downloader()) + yield 'mainnav', 'downloader', html.a('Downloader', href = req.href.downloader()) + #yield 'mainnav', 'downloader', Markup('<a href="%s">Downloader</a>', + # self.env.href.downloader()) # IRequestHandler methods }}}


Add/Change #3029 (TracDownloader with TracTags problem?)




Change Properties
Action