Modify

Opened 4 years ago

Closed 4 years ago

#8610 closed defect (fixed)

[patch] 'UnicodeEncodeError' for non-english enviroments

Reported by: hasienda Owned by: airadier
Priority: normal Component: SearchAllPlugin
Severity: normal Keywords: unicode
Cc: rjollos Trac Release: 0.12

Description

I've tested this plugin tonight and it seems to work quit well.

But there is at least one issue with Trac>=0.12 for non-English Trac environments, whenever non-ASCII chars are encountered in exceptions. The fix is trivial in this case:

searchall_build/tracsearchall/searchall.py  2011-03-16 00:22:23.000000000 +0100
@@ -17,6 +17,7 @@
 from trac.env import open_environment
 from trac.util import Markup
 from trac.util.datefmt import to_datetime
+from trac.util.text import to_unicode
 
 import re
 import posixpath
@@ -160,7 +161,7 @@
                     except Exception, ex:
                         results += [(req.href('search', **req.args), 
                             "<strong>ERROR</strong> in search filter <em>%s</em>" % filter,
-                            to_datetime(None), "none", "Exception: %s" % str(ex)),]
+                            to_datetime(None), "none", "Exception: %s" % to_unicode(ex)),]
             
             req.href = orig_href

}

Attachments (0)

Change History (6)

comment:1 Changed 4 years ago by hasienda

  • Type changed from enhancement to defect

Oh, this was certainly meant to become a bug report.

comment:2 follow-up: Changed 4 years ago by rjollos

Steffen, ping me again on this in two weeks if the author doesn't respond and I'll push it to the repository. I'm pretty sure that airadier isn't around anymore.

comment:3 in reply to: ↑ 2 Changed 4 years ago by rjollos

Replying to rjollos:

I'm pretty sure that airadier isn't around anymore.

Most recent checkin by airadier is for the ParametrizedTemplatesPlugin in Nov 2010, so perhaps I'm wrong on that.

comment:4 follow-up: Changed 4 years ago by airadier

Hi jrollos, I'm here around but I hardly can get time to fix the pending issues.

I would agree if you can push the changes, just mail otaku42 and comment about this (you can provide this ticket as a proof I agree).

Thanks.

comment:5 in reply to: ↑ 4 Changed 4 years ago by hasienda

Replying to airadier:

Hi jrollos, I'm here around but I hardly can get time to fix the pending issues.

I would agree if you can push the changes, just mail otaku42 and comment about this (you can provide this ticket as a proof I agree).

Thanks to both of you for taking care. As I added this plugin to the production plugin stack at work I'm very interested in fixes and improvements. As mentioned it #8611 I'm willing to cooperate as well, if you need a helping hand. Please read this ticket and any future one with this offer in mind.

comment:6 Changed 4 years ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

(In [9966]) Support non-ascii characters to in exceptions. Thanks to hasienda for the patch. Fixes #8610.

Add Comment

Modify Ticket

Action
as closed The owner will remain airadier.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.