Edgewall Software

Ticket #2903 (closed defect: fixed)

Opened 3 years ago

Last modified 3 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:

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

Changed 3 years ago by cboos

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

If not, can you try to upgrade?

Changed 3 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.

Changed 3 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 :(

Changed 3 years ago by cmlenz

  • description modified (diff)

Cleaning up the traceback…

Changed 3 years ago by cmlenz

  • status changed from new to assigned
  • component changed from mod_python frontend to wiki
  • milestone set to 0.10

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

Changed 3 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed
  • component changed from wiki to general

Fixed in [3029].

Add/Change #2903 (UnicodeEncodeError: 'ascii' codec can't encode character u'\\xe8' in position 15)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cmlenz. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.