Modify

Opened 10 years ago

Closed 10 years ago

#11639 closed defect (fixed)

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

Reported by: Aaron Owned by: falkb
Priority: normal Component: SimpleMultiProjectPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

How to Reproduce

While doing a GET operation on /roadmap, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{}

User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0

System Information

Trac 1.0.1
Agilo 0.9.12
Babel 0.9.6
Docutils 0.8.1
Genshi 0.7 (with speedups)
Pygments 1.4
pysqlite 2.6.3
Python 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3]
pytz 2011k
setuptools 0.6
SQLite 3.7.9
Subversion 1.6.17 (r1128011)
jQuery 1.7.2

Enabled Plugins

agilo 0.9.12
SimpleMultiProject 0.0.4dev-r13735
TracAccountManager 0.4.3

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/web/main.py", line 233, in dispatch
    content_type)
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/web/chrome.py", line 983, in render_template
    stream |= self._filter_stream(req, method, filename, stream, data)
  File "/usr/local/lib/python2.7/dist-packages/Genshi-0.7-py2.7-linux-x86_64.egg/genshi/core.py", line 133, in __or__
    return Stream(_ensure(function(self)), serializer=self.serializer)
  File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/web/chrome.py", line 1162, in inner
    data)
  File "build/bdist.linux-x86_64/egg/simplemultiproject/roadmap.py", line 70, in filter_stream
    stream = stream | filter.before(tag.label("Filter Projects:")) | filter.before(tag.br()) | filter.before(self._projects_field_input(req, filter_projects)) | filter.before(tag.br())
  File "build/bdist.linux-x86_64/egg/simplemultiproject/roadmap.py", line 77, in _projects_field_input
    cursor = self.__SmpModel.get_all_projects_filtered_by_conditions(req)
  File "build/bdist.linux-x86_64/egg/simplemultiproject/model.py", line 108, in get_all_projects_filtered_by_conditions
    project_info = self.get_project_info(project_name)
  File "build/bdist.linux-x86_64/egg/simplemultiproject/model.py", line 80, in get_project_info
    cursor.execute(query, [str(name)])
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

Attachments (0)

Change History (5)

comment:1 Changed 10 years ago by Cauly

Component: SELECT A HACKSimpleMultiProjectPlugin
Owner: changed from anonymous to falkb

I think this problem is most proberly issued by SimpleMultiProjectPlugin

comment:2 Changed 10 years ago by falkb

Please, can you give me the text snippet causing the problem?

comment:3 Changed 10 years ago by anonymous

in model.py:

80 cursor.execute(query, [str(name)])

cursor.execute(query,[unicode(name)])

comment:4 Changed 10 years ago by falkb

Status: newaccepted

thank you. I'm testing it now

comment:5 Changed 10 years ago by falkb

Resolution: fixed
Status: acceptedclosed

In 13786:

fixed #11639: unicode encode error in get_project_info() fixed, thanks to aaron315

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain falkb.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.