Ticket #8610 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] 'UnicodeEncodeError' for non-english enviroments

Reported by: hasienda Assigned to: 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

Change History

03/16/11 00:39:31 changed by hasienda

  • type changed from enhancement to defect.

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

(follow-up: ↓ 3 ) 03/16/11 01:03:22 changed 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.

(in reply to: ↑ 2 ) 03/16/11 01:04:54 changed 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.

(follow-up: ↓ 5 ) 03/16/11 11:56:17 changed 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.

(in reply to: ↑ 4 ) 03/16/11 20:17:11 changed 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.

03/17/11 05:39:31 changed by rjollos

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #8610 ([patch] 'UnicodeEncodeError' for non-english enviroments)




Change Properties
Action