Opened 19 years ago
Closed 17 years ago
#3024 closed defect (fixed)
Cannot render (or upgrade) some wiki pages.
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | high | Milestone: | 0.10 |
Component: | wiki system | Version: | 0.9.4 |
Severity: | normal | Keywords: | unicode |
Cc: | pacopablo@…, tjb@…, matt_tricks@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When trying to access the TracReports wiki page, we see the following error
Python Traceback Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 300, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 176, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.3/site-packages/trac/wiki/web_ui.py", line 117, in process_request self._render_view(req, db, page) File "/usr/lib/python2.3/site-packages/trac/wiki/web_ui.py", line 364, in _render_view req.hdf['wiki.page_html'] = wiki_to_html(page.text, self.env, req) File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 826, in wiki_to_html return Markup(out.getvalue()) File "/usr/lib/python2.3/StringIO.py", line 203, in getvalue self.buf += ''.join(self.buflist) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 63: ordinal not in range(128) searchHighlight()
This is apparently another unicode problem, and is consistent across our trac installations. It also occurs on some other wiki pages.
At the same time, trac-admin wiki upgrade fails when trying to upgrade TracReports, and gets no further.
It reports an error when trying to decode a character - I'll look for the details and attache them when I can.
Our current trac version is 3130, and we are running on Suse Enterprise Linux 9, Apache 2.0.49, and mod-python.
Attachments (0)
Change History (13)
comment:1 by , 19 years ago
Keywords: | unicode added |
---|---|
Milestone: | → 0.10 |
Owner: | changed from | to
Priority: | normal → high |
comment:2 by , 19 years ago
Cc: | added |
---|
I ran into this error too. You patch fixed it cboos. However, your last change [3138] broke format_datetime. You forgot to specify the module name when calling getlocale. Here is the patch
Index: util/__init__.py =================================================================== --- util/__init__.py (revision 3138) +++ util/__init__.py (working copy) @@ -208,7 +208,7 @@ t = time.localtime(int(t)) text = time.strftime(format, t) - lc_time_encoding = sys.platform != 'win32' and getlocale(locale.LC_TIME)[1] + lc_time_encoding = sys.platform != 'win32' and locale.getlocale(locale.LC_TIME)[1] encoding = lc_time_encoding or locale.getpreferredencoding() return unicode(text, encoding, 'replace')
comment:3 by , 19 years ago
Cc: | added |
---|
I updated to [3139], and applied both of the above patches.
The result is still the same, with an identical traceback to the original.
Running trac-admin wiki upgrade still fails as well.
comment:5 by , 19 years ago
I upgraded to 3141, and had effectively no change. Some of the line numbers have changed, but the stack trace is the same.
I am leaving work in 30 minutes, and won't be back for 7 days - therefore cannot do any more testing in the short term. Sorry - I'll check the ticket from time to time at home.
comment:7 by , 19 years ago
Here it is
Python Traceback Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 301, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 177, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.3/site-packages/trac/wiki/web_ui.py", line 117, in process_request self._render_view(req, db, page) File "/usr/lib/python2.3/site-packages/trac/wiki/web_ui.py", line 364, in _render_view req.hdf['wiki.page_html'] = wiki_to_html(page.text, self.env, req) File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 827, in wiki_to_html return Markup(out.getvalue()) File "/usr/lib/python2.3/StringIO.py", line 203, in getvalue self.buf += ''.join(self.buflist) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 63: ordinal not in range(128)
comment:8 by , 19 years ago
I updated to [3222] today, tried the wiki upgrade, and it works. The wiki pages display normally as well. I don't know what might have changed to fix this over the last week, my skim of the timeline showed nothing obvious.
The return to_unicode(…) patch is still in place.
I will leave it to you to close this if you are happy - thanks.
comment:9 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I'm quite sure it was [3141] which fixed it… maybe a wrong install step on your part at that time. Well, never mind, now it works :)
The patch adding to_unicode()
in _macro_processor
is not necessary anymore,
as this is now done at a later stage (in process()
). You should revert it.
I think we can close this one now.
follow-up: 13 comment:10 by , 18 years ago
Cc: | added |
---|---|
Milestone: | 0.10 → 0.11 |
Resolution: | fixed |
Status: | closed → reopened |
Hi guys,
I'm still seeing this in the latest 0.11dev subversion code.
Any ideas?
I also get UnicodeDecodeErrors in my wiki nder some of the help pages. Perhaps my setup is wrong but I can't for the life of me think how.
See my comments under {3908} for more details including my version info.
Cheers, Matt
follow-up: 12 comment:11 by , 18 years ago
Err, of course I meant to link to the ticket number: #3908
comment:13 by , 17 years ago
Milestone: | 0.11.1 → 0.10 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
I think I know why. From
StringIO.py
:You certainly have a macro which still produces output as
str
objects.Could you try the following patch?