You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2011/03/15 18:17:29 UTC

[jira] Closed: (THRIFT-1093) several bugs in python TCompactProtocol

     [ https://issues.apache.org/jira/browse/THRIFT-1093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury closed THRIFT-1093.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.7
         Assignee: Will Pierce

I just committed this.

> several bugs in python TCompactProtocol
> ---------------------------------------
>
>                 Key: THRIFT-1093
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1093
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Library
>    Affects Versions: 0.6
>            Reporter: Will Pierce
>            Assignee: Will Pierce
>             Fix For: 0.7
>
>         Attachments: THRIFT-1093.compactproto_encoding_bugs.patch
>
>
> The python TCompactProtocol implementation has a few bugs:
> * In the writeBool method:
> ** the code has a typo in the spelling of AssertionError
> ** code fails when accessing a nonexistent types[] dict to encode the boolean
> * The TType.STOP token was missing from the CTYPES dict and CompactType class, so empty sequence types failed to decode with an error in __getTType looking for TTYPES[0] and not finding it
> The SerializationTest.py code has a few small issues:
> * the code didn't compare the full serialization/deserialization for the versioningV1/V2 structs, only a couple fields
> * the VersioningTestV2 object has a set() field that is initialized to a list, not a set
> * the Compact Protocol code for handling field ID deltas >= 15 wasn't exercised
> I have a patch to fix the problem with TCompactProtocol encoding Booleans, and updated the test cases to specifically test Booleans (using ThriftTest.ttypes's Bools).
> I extended the SerializationTest.py code to include testing of the DebugProtoTest,ttype's CompactProtoTestStruct, manually setting its values (where possible) to the values from the const COMPACT_TEST in DebugProtoTest.thrift.  This uncovered the bug in handling decoding of empty Map types, which is the bug caused by the missing TType.STOP token in the local CTYPES[] dict().

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira