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
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