You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "James E. King III (JIRA)" <ji...@apache.org> on 2018/05/15 03:06:00 UTC

[jira] [Commented] (THRIFT-4563) TBinaryProtocol exits at first 0 or "/x00" byte.

    [ https://issues.apache.org/jira/browse/THRIFT-4563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16475230#comment-16475230 ] 

James E. King III commented on THRIFT-4563:
-------------------------------------------

We use Resolution Fixed for things that actually changed in Thrift.  This sounds like a question that was answered perhaps?  I'm going to change it to that for now.

> TBinaryProtocol exits at first 0 or "/x00" byte.
> ------------------------------------------------
>
>                 Key: THRIFT-4563
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4563
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Library
>    Affects Versions: 0.11.0
>         Environment: python3.6
>            Reporter: Yerzhan Kaskabay
>            Priority: Blocker
>
> 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.
> {color:#FF0000}while True:{color}
>             (fname, ftype, fid) = iprot.readFieldBegin()
>             {color:#FF0000}if ftype == TType.STOP:{color}
> {color:#FF0000}                break{color}
>             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?
>   
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)