Disable smart strings in lxml XPath evaluations

This commit is contained in:
Paul Tremberth 2014-01-15 15:17:18 +01:00
parent d8164bd5f4
commit 1f184ed7bf
1 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,8 @@ class Selector(object_ref):
return SelectorList([])
try:
result = xpathev(query, namespaces=self.namespaces)
result = xpathev(query, namespaces=self.namespaces,
smart_strings=False)
except etree.XPathError:
raise ValueError("Invalid XPath: %s" % query)