Edgewall Software
Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11365 closed defect (cantfix)

TypeError: decoding Unicode is not supported

Reported by: matheusslima@… Owned by:
Priority: normal Milestone:
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

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

TracForge

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 (4)

comment:1 by Jun Omae, 11 years ago

Resolution: cantfix
Status: newclosed

comment:2 by anonymous, 11 years ago

Hi jomae,

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 by anonymous, 11 years ago

Thanks man!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.