Skip to content
This repository was archived by the owner on Nov 21, 2017. It is now read-only.

Commit b9a2a88

Browse files
committed
Fix issue #18: IntNodes need to use unicode
Schema usage requires unicode. This changeset brings IntNodes in-line with that necessity.
1 parent 4e7c988 commit b9a2a88

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

l2cs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import whoosh.query
1818

1919

20-
__version__ = "2.0.0"
20+
__version__ = "2.0.1"
2121

2222

2323
HANDLERS = {}
@@ -102,7 +102,7 @@ def walk_clause(clause):
102102
class IntNode(whoosh.qparser.syntax.WordNode):
103103
def __init__(self, value):
104104
self.__int_value = int(value)
105-
whoosh.qparser.syntax.WordNode.__init__(self, str(self.__int_value))
105+
whoosh.qparser.syntax.WordNode.__init__(self, unicode(self.__int_value))
106106

107107
def query(self, parser):
108108
q = whoosh.qparser.syntax.WordNode.query(self, parser)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use_setuptools()
88
from setuptools import setup
99

10-
version = "2.0.0"
10+
version = "2.0.1"
1111

1212
setup(
1313
name='l2cs',

test_l2cs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ def test_minus_in_parentheses(self):
155155

156156
def test_minus_midword(self):
157157
self._run_test(u"baz:foo-bar", u"(field baz 'foo-bar')")
158+
159+
def test_unicode_intnodes1(self):
160+
'''Clauses with integers should work with schemas
161+
As reported in https://github.com/kemitche/l2cs/issues/18
162+
163+
'''
164+
try:
165+
self._run_test(u"count:1", u"count:1", self.schema_parser)
166+
except AssertionError as e:
167+
self.fail(e)
158168

159169

160170
if __name__ == '__main__':

0 commit comments

Comments
 (0)