Modify ↓
#11481 closed defect (fixed)
Browsing debug data nodes generates "Can't send unicode data" error with genshi-0.7
Reported by: | lkraav | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Component: | TracDeveloperPlugin |
Severity: | normal | Keywords: | |
Cc: | Ryan J Ollos | Trac Release: |
Description
Attachments (0)
Change History (11)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Hmm, trunk but I haven't pulled for a while now.
62b5507 - (origin/trunk, trunk) Merge r11675 from 1.0-stable (#11045) (11 months ago) <cboos>
comment:6 Changed 10 years ago by
I think we should just return template with data from process_request
rather than rendering a template in the method. Trac core works well with both Genshi 0.6.x and 0.7.0.
-
tracdeveloperplugin/trunk/tracdeveloper/debugger.py
diff --git a/tracdeveloperplugin/trunk/tracdeveloper/debugger.py b/tracdeveloperplugin/trunk/tracdeveloper/debugger.py index 94ed106..1f8a7a6 100644
a b class TemplateDebugger(Component): 86 86 key = token + ':' + path.split(':', 1)[0] 87 87 data = self._cache.get(key) 88 88 if not data: 89 raise HTTPNotFound( )89 raise HTTPNotFound("Not found '%s'" % path) 90 90 node = data.lookup(path) 91 91 data = {'node': node, 'drillable': self._is_drillable(req)} 92 output = Chrome(self.env).render_template(req, 'developer/debug_node.html', 93 data, fragment=True) 94 req.send(output.render('xhtml'), 'text/html') 92 return 'developer/debug_node.html', data, None 95 93 96 94 # Internal methods 97 95
comment:7 Changed 10 years ago by
Also, I think TemplateDebugger
component must check whether a user has TRAC_DEVELOP
permission.
-
tracdeveloperplugin/trunk/tracdeveloper/debugger.py
diff --git a/tracdeveloperplugin/trunk/tracdeveloper/debugger.py b/tracdeveloperplugin/trunk/tracdeveloper/debugger.py index 94ed106..194d823 100644
a b class TemplateDebugger(Component): 28 28 return handler 29 29 30 30 def post_process_request(self, req, template, data, content_type): 31 if 'debug' not in req.args :31 if 'debug' not in req.args or 'TRAC_DEVELOP' not in req.perm: 32 32 return template, data, content_type 33 33 34 34 # Purge outdated debug info from cache … … class TemplateDebugger(Component): 67 67 # IRequestHandler methods 68 68 69 69 def match_request(self, req): 70 match = re.match(r'/developer/debug(?:/(.*))?$', req.path_info) 71 if match: 72 req.args['path'] = match.group(1) 73 return True 70 if 'TRAC_DEVELOP' in req.perm: 71 match = re.match(r'/developer/debug(?:/(.*))?$', req.path_info) 72 if match: 73 req.args['path'] = match.group(1) 74 return True 74 75 75 76 def process_request(self, req): 76 77 header = req.get_header('X-Requested-With')
comment:8 Changed 10 years ago by
Cc: | Ryan J Ollos added; anonymous removed |
---|
comment:11 Changed 9 years ago by
Owner: | changed from Olemis Lang to Jun Omae |
---|
Note: See
TracTickets for help on using
tickets.
yes, please ... Trac release ?