Edgewall Software

Changes between Initial Version and Version 14 of Ticket #7959


Ignore:
Timestamp:
Feb 7, 2009, 5:44:04 PM (13 years ago)
Author:
Christian Boos
Comment:

I can reproduce the original error (well, the one in comment:8 actually) and now with r7822, this gives a slightly different backtrace:

Traceback (most recent call last):
  File "C:\Workspace\src\trac\repos\0.11-stable\trac\web\api.py", line 367, in send_error
    'text/html')
  File "C:\Workspace\src\trac\repos\0.11-stable\trac\web\chrome.py", line 742, in render_template
    stream.render(method, doctype=doctype, out=buffer)
  File "build\bdist.win32\egg\genshi\core.py", line 179, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "build\bdist.win32\egg\genshi\output.py", line 57, in encode
    for chunk in iterator:
  File "build\bdist.win32\egg\genshi\output.py", line 307, in __call__
    for kind, data, pos in stream:
  File "build\bdist.win32\egg\genshi\output.py", line 749, in __call__
    for kind, data, pos in stream:
  File "build\bdist.win32\egg\genshi\output.py", line 588, in __call__
    for kind, data, pos in stream:
  File "build\bdist.win32\egg\genshi\output.py", line 703, in __call__
    text = mjoin(textbuf, escape_quotes=False)
  File "build\bdist.win32\egg\genshi\core.py", line 465, in join
    for item in seq]))
  File "build\bdist.win32\egg\genshi\core.py", line 494, in escape
    text = unicode(text).replace('&', '&') \
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 63: ordinal not in range(128)

This is shown as "raw" content, as the error actually happens during send_error. There's also no hint about where that error comes from (in my test, I just put a non-ascii character in the repository_dir).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7959

    • Property Status newassigned
    • Property Severity normalcritical
    • Property Priority normalhigh
    • Property Keywords genshi added
    • Property Milestone0.11.3
    • Property Owner set to Christian Boos
  • Ticket #7959 – Description

    initial v14  
    1 as there are so many unicode errors, does it make sense to do a guaranteed encoding at some point, like described in http://code.activestate.com/recipes/466341/ ?
     1... as there are so many unicode errors, does it make sense to do a guaranteed encoding at some point, like described in http://code.activestate.com/recipes/466341/ ?
     2
     3Example error:
     4One of my test SVN repositories was deliberately created in a way that its name contains cyrillic characters, e.g. /home/svn/борис. Accessing this with Apache's mod_dav_svn works, but trac gives the following error:
     5{{{
     6Traceback (most recent call last):
     7  File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 339, in send_error
     8    'text/html')
     9  File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 715, in render_template
     10    return stream.render(method, doctype=doctype)
     11  File "/var/lib/python-support/python2.5/genshi/core.py", line 179, in render
     12    return encode(generator, method=method, encoding=encoding, out=out)
     13  File "/var/lib/python-support/python2.5/genshi/output.py", line 60, in encode
     14    return _encode(u''.join(list(iterator)))
     15  File "/var/lib/python-support/python2.5/genshi/output.py", line 311, in __call__
     16    for kind, data, pos in stream:
     17  File "/var/lib/python-support/python2.5/genshi/output.py", line 753, in __call__
     18    for kind, data, pos in stream:
     19  File "/var/lib/python-support/python2.5/genshi/output.py", line 592, in __call__
     20    for kind, data, pos in stream:
     21  File "/var/lib/python-support/python2.5/genshi/output.py", line 707, in __call__
     22    text = mjoin(textbuf, escape_quotes=False)
     23UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 49: ordinal not in range(128)
     24}}}
     25(from comment:8)
     26
     27