I am currently upgrading a real-life project to 0.9.7beta4 and encountered
the following problem:

=====================
Exception happened during processing of request from ('127.0.0.1', 39293)
Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/paste/httpserver.py", line 1053, in 
process_request_in_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.4/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.4/SocketServer.py", line 521, in __init__
    self.handle()
  File "/var/lib/python-support/python2.4/paste/httpserver.py", line 432, in 
handle
    BaseHTTPRequestHandler.handle(self)
  File "/usr/lib/python2.4/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
  File "/var/lib/python-support/python2.4/paste/httpserver.py", line 427, in 
handle_one_request
    self.wsgi_execute()
  File "/var/lib/python-support/python2.4/paste/httpserver.py", line 287, in 
wsgi_execute
    self.wsgi_start_response)
  File "/var/lib/python-support/python2.4/paste/cascade.py", line 121, in 
__call__
    return self.apps[-1](environ, start_response)
  File "/var/lib/python-support/python2.4/paste/registry.py", line 334, in 
__call__
    app_iter = self.application(environ, start_response)
  File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/Pylons-0.9.7beta4-py2.4.egg/pylons/middleware.py",
 line 130, 
in __call__
    resp = orig_resp = req.get_response(self.app, catch_exc_info=True)
  File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebOb-0.9.1-py2.4.egg/webob/__init__.py",
 line 1223, in 
get_response
  File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebOb-0.9.1-py2.4.egg/webob/__init__.py",
 line 1196, in 
call_application
  
File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebError-0.8a-py2.4.egg/weberror/evalexception/middleware.py",
 
line 226, in __call__
    return self.respond(environ, start_response)
  
File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebError-0.8a-py2.4.egg/weberror/evalexception/middleware.py",
 
line 407, in respond
    return debug_info.content()
  
File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebError-0.8a-py2.4.egg/weberror/evalexception/middleware.py",
 
line 461, in content
    traceback_body, extra_data = format_eval_html(self.exc_data, 
self.base_path, self.counter)
  
File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebError-0.8a-py2.4.egg/weberror/evalexception/middleware.py",
 
line 581, in format_eval_html
    show_extra_data=False)[0]
  File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebError-0.8a-py2.4.egg/weberror/exceptions/formatter.py",
 
line 472, in format_xml
    return XMLFormatter(**ops).format_collected_data(exc_data)
  File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebError-0.8a-py2.4.egg/weberror/exceptions/formatter.py",
 
line 394, in format_collected_data
    self.format_long_source(source, long_source, newdoc, xml_frame)
  File 
"/home/chaas/projekte/pylons/0.9.7-test/lib/python2.4/site-packages/WebError-0.8a-py2.4.egg/weberror/exceptions/formatter.py",
 
line 427, in format_long_source
    long_source = long_source.encode('ascii', 'xmlcharrefreplace')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 212: 
ordinal not in range(128)
=====================

In the web browser I just see "Internal error" - not even the online
debugger.

Apprently the reason was that I had a line with non-ascii chars in
lib/base.py. And it wasn't even code - it was just a "#" comment line.
Even adding "# -*- coding: utf-8 -*-" at the top didn't remedy it.
I had to write my umlauts "ΓΌ" like "ue" to circumvent the error.

I'm not sure if this is a problem of weberror or the Pylons template
so I did not yet file a ticket.

Cheers
 Christoph

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to