Opened 10 years ago
Last modified 9 years ago
#11780 closed defect
UnicodeError with its traceback should be logged while rendering genshi template — at Initial Version
Reported by: | Jun Omae | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.5 |
Component: | rendering | Version: | 0.12-stable |
Severity: | normal | Keywords: | genshi |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
If an UnicodeError
raises while rendering genshi template, traceback of the error will not be logged. The behavior makes increasingly difficult to solve, especially if rendering unknown template location.
I think we should log the error with its traceback in this case.
-
trac/web/chrome.py
diff --git a/trac/web/chrome.py b/trac/web/chrome.py index 344448b..fd14cbd 100644
a b class Chrome(Component): 885 885 req.chrome['script_data'] = script_data 886 886 # give some hints when hitting a Genshi unicode error 887 887 if isinstance(e, UnicodeError): 888 self.log.error('Exception caught while rendering %s%s', 889 filename, 890 exception_to_unicode(e, traceback=True)) 888 891 pos = self._stream_location(stream) 889 892 if pos: 890 893 location = "'%s', line %s, char %s" % pos
Note:
See TracTickets
for help on using tickets.