Modify ↓
#11388 closed defect (fixed)
TypeError: decoding Unicode is not supported
Reported by: | Owned by: | Jun Omae | |
---|---|---|---|
Priority: | normal | Component: | TracForgePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
How to Reproduce
While doing a GET operation on /projects/analistas/browser/Baselines
,
Trac issued an internal error.
I'm trying to migrate some TRAC projects from a old 0.12dev-r7634 to a new 0.12.5 installation
Request parameters:
{}
User agent: `Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0`
System Information
TRAC 0.12.5
Enabled Plugins
TracForgePlugin
Python Traceback
Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 522, in _dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 199, in dispatch if handler.match_request(req): File "/usr/local/lib/python2.7/dist- packages/TracForge-1.1-py2.7.egg/tracforge/admin/dispatch.py", line 117, in match_request self._send_project(req, path_info) File "/usr/local/lib/python2.7/dist- packages/TracForge-1.1-py2.7.egg/tracforge/admin/dispatch.py", line 196, in _send_project req._response = dispatch_request(environ, start_response) File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 490, in dispatch_request return _dispatch_request(req, env, env_error) File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 566, in _dispatch_request send_internal_error(env, req, sys.exc_info()) File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 645, in send_internal_error description_en = get_description(lambda s, **kw: safefmt(s, kw)) File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 640, in get_description method=req.method, path_info=req.path_info, File "/usr/lib/python2.7/dist-packages/trac/web/api.py", line 250, in path_info return unicode(path_info, 'utf-8') TypeError: decoding Unicode is not supported
Attachments (0)
Change History (6)
comment:1 Changed 11 years ago by
comment:3 Changed 11 years ago by
i have made the following changes on "/usr/lib/python2.7/dist-packages/trac/web/api.py" and now works:
@property def path_info(self): """Path inside the application""" path_info = self.environ.get('PATH_INFO', '') try: return unicode(path_info, 'utf-8') # except UnicodeDecodeError: # raise HTTPNotFound(_("Invalid URL encoding (was %(path_info)r)", # path_info=path_info)) except (TypeError, UnicodeDecodeError): return path_info @property
comment:4 Changed 11 years ago by
No, that is a TracForgePlugin issue, not a Trac issue.
The issue is probably caused by changing environ['PATH_INFO']
to unicode instance.
-
branches/bewst/0.11-clearsilver/tracforge/admin/dispatch.py
164 164 return self.start_response(*args) 165 165 166 166 environ['SCRIPT_NAME'] = req.href.projects('/') 167 environ['PATH_INFO'] = path_info 167 environ['PATH_INFO'] = path_info.encode('utf-8') 168 168 environ['trac.env_parent_dir'] = os.path.dirname(self.env.path) 169 169 if 'TRAC_ENV' in environ: 170 170 del environ['TRAC_ENV']
comment:5 Changed 9 years ago by
Owner: | Noah Kantrowitz deleted |
---|
comment:6 Changed 9 years ago by
Owner: | set to Ryan J Ollos |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In 15303:
comment:7 Changed 9 years ago by
Owner: | changed from Ryan J Ollos to Jun Omae |
---|
Note: See
TracTickets for help on using
tickets.
Maybe this would help:???
http://stackoverflow.com/a/3858057/2805430