supybot search unicode fix
Toshio Kuratomi
a.badger at gmail.com
Wed Jun 13 18:43:30 UTC 2012
Here's a patch to fix .fas search when a keyword with unicode in it is used.
-Toshio
-------------- next part --------------
From 7cad838fbc44a39ece099c468232ff0d73bc4d10 Mon Sep 17 00:00:00 2001
From: Toshio Kuratomi <toshio at fedoraproject.org>
Date: Wed, 13 Jun 2012 11:04:58 -0700
Subject: [PATCH] Fix a unicode traceback when searching for a fas user
---
plugin.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/plugin.py b/plugin.py
index f3f5ac9..e8a7d00 100644
--- a/plugin.py
+++ b/plugin.py
@@ -45,6 +45,8 @@ from fedora.client.fas2 import AccountSystem
from fedora.client.fas2 import FASError
from fedora.client.pkgdb import PackageDB
+from kitchen.text.converters import to_unicode
+
import simplejson
import urllib
import commands
@@ -212,6 +214,7 @@ class Fedora(callbacks.Plugin):
Search the Fedora Account System usernames, full names, and email
addresses for a match."""
+ find_name = to_unicode(find_name)
matches = []
for entry in self.faslist.keys():
if entry.find(find_name.lower()) != -1:
--
1.7.7.6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20120613/693d10a5/attachment.sig>
More information about the infrastructure
mailing list