skybot
skybot copied to clipboard
gcalc chokes on
If you do a request that results in a number that is separated with a space skybot will choke. For example, request 1*10000
which will return 10 000
:
16:02:35 #ijustam <ijustam> .calc 1*10000
Unhandled exception in thread started by <function run at 0x02C17C30>
Traceback (most recent call last):
File "core\main.py", line 80, in run
out = func(input.inp)
File "plugins\gcalc.py", line 10, in calc
m = h.xpath('//h2[@class="r"]/text()')
File "src/lxml/lxml.etree.pyx", line 1587, in lxml.etree._Element.xpath (src\lxml\lxml.etree.c:61854)
File "src/lxml/xpath.pxi", line 307, in lxml.etree.XPathElementEvaluator.__call__ (src\lxml\lxml.etree.c:178516)
File "src/lxml/xpath.pxi", line 230, in lxml.etree._XPathEvaluatorBase._handle_result (src\lxml\lxml.etree.c:177452)
File "src/lxml/extensions.pxi", line 623, in lxml.etree._unwrapXPathObject (src\lxml\lxml.etree.c:171189)
File "src/lxml/extensions.pxi", line 657, in lxml.etree._createNodeSetResult (src\lxml\lxml.etree.c:171659)
File "src/lxml/extensions.pxi", line 678, in lxml.etree._unpackNodeSetEntry (src\lxml\lxml.etree.c:171886)
File "src/lxml/extensions.pxi", line 804, in lxml.etree._buildElementStringResult (src\lxml\lxml.etree.c:173487)
File "src/lxml/apihelpers.pxi", line 1417, in lxml.etree.funicode (src\lxml\lxml.etree.c:32150)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in position 6: invalid start byte
The HTML result:
<h2 class="r" style="display:inline;font-size:138%">1 * 10 000 = 10 000</h2>