Modify

Opened 9 years ago

Last modified 6 years ago

#12118 new defect

UnicodeEncodeError: 'ascii' codec can't encode character u'\u5230' in position 0: ordinal not in range(128)

Reported by: pu.yun@… Owned by: ejucovy
Priority: normal Component: WorkflowActionButtonsPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

How to Reproduce

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

(please provide additional details here)

Request parameters:

{'id': u'51'}

User agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36

System Information

Trac 1.0.2
Babel 0.9.4
Docutils 0.12
Genshi 0.7 (without speedups)
GIT 1.7.1
MySQL server: "5.1.73", client: "5.1.73", thread-safe: 1
MySQLdb 1.2.3c1
Pygments 2.0.1
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
RPC 1.1.2-r13776
setuptools 7.0
jQuery 1.7.2
jQuery UI 1.8.21
jQuery Timepicker 1.0.1

Enabled Plugins

nevernotifyupdaterplugin 1.0-r12968
trac-WorkflowActionButtons 0.2
TracAccountManager 0.4.4
TracAutocompleteUsersPlugin 0.4.3
TracIniAdminPanel 1.0.1-r14244
TracMasterTickets 3.0.5dev-r13684
TracReportInplaceEditPlugin 0.2
TracSubcomponents 1.2.0
TracSubTicketsPlugin 0.2.0.dev-20141205
TracUsernameDecoratePlugin 0.12.0.1
TracXMLRPC 1.1.2-r13776

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 512, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 240, in dispatch
    content_type)
  File "/usr/lib/python2.6/site-packages/trac/web/chrome.py", line 1009, in render_template
    stream |= self._filter_stream(req, method, filename, stream, data)
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/core.py", line 133, in __or__
    return Stream(_ensure(function(self)), serializer=self.serializer)
  File "/usr/lib/python2.6/site-packages/trac/web/chrome.py", line 1192, in inner
    data)
  File "/usr/lib/python2.6/site-packages/trac_WorkflowActionButtons-0.2-py2.6.egg/workflow_actionbuttons/web_ui.py", line 39, in filter_stream
    buttons.append(manager.render_action_button(req, data['ticket'], action))
  File "/usr/lib/python2.6/site-packages/trac_WorkflowActionButtons-0.2-py2.6.egg/workflow_actionbuttons/api.py", line 66, in render_action_button
    supplemental_form = "<div class='supplemental'><div class='supplemental-form'>%s %s <span class='hint'>%s</span><textarea style='width:95%%' rows='5' name='comment' placeholder='Enter your comment'></textarea><input type='submit' /></div></div>" % (action.title(), str(widgets), hints)
  File "/usr/lib/python2.6/site-packages/Genshi-0.7-py2.6-linux-x86_64.egg/genshi/builder.py", line 107, in __str__
    return str(self.generate())
UnicodeEncodeError: 'ascii' codec can't encode character u'\u5230' in position 0: ordinal not in range(128)

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by Ryan J Ollos

As a workaround you may want to try rolling back to Genshi 0.6.1.

comment:2 Changed 7 years ago by Ryan J Ollos

Please post your [ticket-workflow] section.

comment:3 Changed 6 years ago by ricardopiccini@…

I receive almost de same error:

Informação do Sistema

PacoteVersão
Trac1.2.2
Babel0.9.6
Genshi0.6 (without speedups)
GIT2.17.1.windows.1
mod_wsgi3.5 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})
pysqlite2.6.3
Python2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)]
setuptools20.9.0
SQLite3.7.6.2

Plugins Instalados

NomeVersãoLocalização
trac-workflowactionbuttons 0.3 d:\trac-1.2.2-4\python\lib\site-packages\trac_workflowactionbuttons-0.3-py2.7.egg
tracaccountmanager 0.5.1.dev0 d:\trac stack projects\apic\plugins\tracaccountmanager-0.5.1.dev0-py2.7.egg
2018-06-05 02:27:06,964 Trac[main] ERROR: [127.0.0.1] Internal Server Error: <RequestWithSession "GET '/ticket/1'">, referrer None
Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\web\main.py", line 623, in _dispatch_request
    dispatcher.dispatch(req)
  File "build\bdist.win32\egg\trac\web\main.py", line 259, in dispatch
    iterable=chrome.use_chunked_encoding)
  File "build\bdist.win32\egg\trac\web\chrome.py", line 1129, in render_template
    stream |= self._filter_stream(req, method, filename, stream, data)
  File "c:\users\ricardop\appdata\local\temp\easy_install-g8ej_3\Genshi-0.6-py2.7-win32.egg.tmp\genshi\core.py", line 132, in __or__
    return Stream(_ensure(function(self)), serializer=self.serializer)
  File "build\bdist.win32\egg\trac\web\chrome.py", line 1442, in inner
    data)
  File "D:\trac-1.2.2-4\python\lib\site-packages\trac_workflowactionbuttons-0.3-py2.7.egg\workflow_actionbuttons\web_ui.py", line 41, in filter_stream
    buttons.append(manager.render_action_button(req, data['ticket'], action))
  File "D:\trac-1.2.2-4\python\lib\site-packages\trac_workflowactionbuttons-0.3-py2.7.egg\workflow_actionbuttons\api.py", line 72, in render_action_button
    supplemental_form = "<div class='supplemental'><div class='supplemental-form'>%s %s <span class='hint'>%s</span><textarea style='width:95%%' rows='5' name='comment' placeholder='Enter your comment'></textarea><input type='submit' /></div></div>" % (action.title(), str(widgets), hints)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 155: ordinal not in range(128)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain ejucovy.

Add Comment


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

 
Note: See TracTickets for help on using tickets.