Edgewall Software
Modify

Ticket #2903 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

UnicodeEncodeError: 'ascii' codec can't encode character u'\\xe8' in position 15

Reported by: athomas Owned by: cmlenz
Priority: normal Milestone: 0.10
Component: general Version: devel
Severity: minor Keywords:
Cc:
Release Notes:
API Changes:

Description (last modified by cmlenz) (diff)

I'm getting this traceback in my Apache logs every now and then:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
    result = object(req)
  File "/usr/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line 86, in handler
    gateway.run(dispatch_request)
  File "/usr/lib/python2.4/site-packages/trac/web/wsgi.py", line 87, in run
    response = application(self.environ, self._start_response)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 320, in dispatch_request
    req.send_error(sys.exc_info(), status=500)
  File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 352, in send_error
    exc_info)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 283, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 170, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/tractags/web_ui.py", line 59, in process_request
  File "/usr/lib/python2.4/site-packages/trac/wiki/web_ui.py", line 116, in process_request
    req.write(page.text)
  File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 405, in write
    self._write(data)
  File "/usr/lib/python2.4/site-packages/trac/web/modpython_frontend.py", line 78, in _write
    self.req.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\\xe8' in position 15: ordinal not in range(128)

Attachments

Change History

comment:1 Changed 6 years ago by cboos

0.10dev after the unicode branch has been merged? (i.e. >= r3024)

If not, can you try to upgrade?

comment:2 Changed 6 years ago by athomas

Yep, pretty sure it was after the unicode merge. I did another update this afternoon, will update the ticket if I see it again.

comment:3 Changed 6 years ago by athomas

  • Description modified (diff)

I'd have a look myself, but I know exactly zip about character encoding and don't have the time to learn it at the moment :(

comment:4 Changed 6 years ago by cmlenz

  • Description modified (diff)

Cleaning up the traceback…

comment:5 Changed 6 years ago by cmlenz

  • Component changed from mod_python frontend to wiki
  • Milestone set to 0.10
  • Status changed from new to assigned

This is about requests for the plain text view of wiki pages. Trac tries to write unicode data to the response, which then gets encoded to ASCII (instead of UTF-8).

Probably similar problems elsewhere where we use req.write().

comment:6 Changed 6 years ago by cmlenz

  • Component changed from wiki to general
  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [3029].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cmlenz. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.