-
Type:
Question
-
Status: Closed
-
Priority:
Minor
-
Resolution: Information Provided
-
Affects Version/s: 0.11.0
-
Fix Version/s: None
-
Component/s: Python - Library
-
Labels:None
-
Environment:
python3.6
Tried to deserialize binary file using deserialize function in thrift.TSerialization.py file. Used TBinaryProtocol and thrift file created by Java developer. Generated ttypes.py have while loop that runs till break if byte=0.
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.I64:
self.sessionId = iprot.readI64()
else:
iprot.skip(ftype)
...
As far as I understood protocol cannot have 0 byte and breaks when first 0 appears. Seems as a bug for me! Isn't there more advanced way to check for the end of file?