Skip to content

Commit 7d3ebb6

Browse files
committed
Fix Issue2550609, hopefully for real, this time.
1 parent 90cdeb4 commit 7d3ebb6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

roundup/backends/indexer_rdbms.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ def add_text(self, identifier, text, mime_type='text/plain'):
6464
self.db.cursor.execute(sql, (id, ))
6565

6666
# ok, find all the unique words in the text
67-
def tryencode(str):
68-
if not isinstance(str, unicode):
69-
str = str.encode("utf-8", "replace")
70-
return str
71-
text = tryencode(text).upper()
67+
if not isinstance(text, unicode):
68+
text = unicode(text, "utf-8", "replace")
69+
text = text.upper()
7270
wordlist = [w.encode("utf-8")
7371
for w in re.findall(r'(?u)\b\w{%d,%d}\b'
7472
% (self.minlength, self.maxlength), text)]

0 commit comments

Comments
 (0)