Closed pidupuis closed 7 years ago
This issue is now fixed, please get the latest version from github (it is not yet published on pypi). Thanks for your report.
import pyRserve
conn = pyRserve.connect(host="172.16.82.159",port=6311)
conn.eval("library(Rserve)")
conn.eval("Rserve()")
conn.eval("library(RJDBC)")
conn.eval("library('rjson')")
conn.eval("library('jsonlite')")
conn.eval("library('lubridate')")
conn.eval("drv<-JDBC('org.apache.hive.jdbc.HiveDriver',list.files('/opt/cloudera/parcels/CDH/jars',pattern='jar$',full.names=T,recursive=TRUE))")
Traceback (most recent call last):
File "I:\workspace\python\pyRserveTest.py", line 18, in <module>
conn.eval("drv<-JDBC('org.apache.hive.jdbc.HiveDriver',list.files('/opt/cloudera/parcels/CDH/jars',pattern='jar$',full.names=T,recursive=TRUE))")
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rconn.py", line 78, in decoCheckIfClosed
return func(self, *args, **kw)
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rconn.py", line 170, in eval
message = rparse(src, atomicArray=atomicArray)
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 640, in rparse
return rparser.parse()
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 438, in parse
message = self._parse()
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 466, in _parse
lexeme = self._parseExpr()
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 479, in _parseExpr
lexeme.setAttr(self._parseExpr())
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 482, in _parseExpr
self[None])(self, lexeme)
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 608, in xt_list_tag
value, tag = self._parseExpr().data, self._parseExpr().data
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 482, in _parseExpr
self[None])(self, lexeme)
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 540, in xt_array
data = self._nextExprData(lexeme)
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 488, in _nextExprData
data = self.lexer.nextExprData(lexeme)
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 288, in nextExprData
return self.lexerMap[lexeme.rTypeCode](self, lexeme)
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 351, in xt_array_str
strList = [stringEncode(byteString) for byteString in bytesStrList]
File "G:\IT-learn\python35\lib\site-packages\pyRserve\rparser.py", line 351, in <listcomp>
strList = [stringEncode(byteString) for byteString in bytesStrList]
File "G:\IT-learn\python35\lib\site-packages\pyRserve\misc.py", line 52, in stringEncode
return byteData.decode(encoding=encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Hello , i encountered such a problem when it executed in win64, please give me an idea .Thank you very much.
It works if I comment the following line:
self._buffer.write('\x00\x00\x00\x00') # data offset, zero by default
Any idea?