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

Roger Meier commented on THRIFT-1797:
-------------------------------------

Hi Avi, thanks for the patch!

I would prefer to have a dedicated file for the TSimpleJSONProtocol, e.g.
lib/py/src/protocol/TSimpleJSONProtocol.py
however, I'm fine with this as long as TSimpleJSONProtocol is adding just a few 
lines of code

the reason for not committing this is the following:
{noformat}
Testing script: /usr/bin/python ./TSimpleJSONProtocolTest.py 
--genpydir=gen-py-default
----
EE.
E======================================================================
ERROR: testComplicated (__main__.SimpleJSONProtocolTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./TSimpleJSONProtocolTest.py", line 102, in testComplicated
    self.assertDictEqual(expected, actual)
AttributeError: 'SimpleJSONProtocolTest' object has no attribute 
'assertDictEqual'

======================================================================
ERROR: testSimpleMessage (__main__.SimpleJSONProtocolTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./TSimpleJSONProtocolTest.py", line 69, in testSimpleMessage
    self.assertDictEqual(expected, actual)
AttributeError: 'SimpleJSONProtocolTest' object has no attribute 
'assertDictEqual'

----------------------------------------------------------------------
Ran 3 tests in 0.001s

FAILED (errors=2)
E.
======================================================================
ERROR: testComplicated (__main__.SimpleJSONProtocolTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./TSimpleJSONProtocolTest.py", line 102, in testComplicated
    self.assertDictEqual(expected, actual)
AttributeError: 'SimpleJSONProtocolTest' object has no attribute 
'assertDictEqual'

======================================================================
ERROR: testSimpleMessage (__main__.SimpleJSONProtocolTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./TSimpleJSONProtocolTest.py", line 69, in testSimpleMessage
    self.assertDictEqual(expected, actual)
AttributeError: 'SimpleJSONProtocolTest' object has no attribute 
'assertDictEqual'

----------------------------------------------------------------------
Ran 3 tests in 0.001s

FAILED (errors=2)
Traceback (most recent call last):
  File "./RunClientServer.py", line 168, in <module>
    runScriptTest(genpydir, script)
  File "./RunClientServer.py", line 108, in runScriptTest
    raise Exception("Script subprocess failed, retcode=%d, args: %s" % (ret, ' 
'.join(script_args)))
Exception: Script subprocess failed, retcode=1, args: /usr/bin/python 
./TSimpleJSONProtocolTest.py --genpydir=gen-py-default
FAIL: RunClientServer.py
==================
1 of 1 test failed
==================
make[1]: *** [check-TESTS] Error 1

{noformat}
could you please have a look on this and resend a patch?

regards
roger

ps: you can fork directly from the mirror at https://github.com/apache/thrift

                
> Python implementation of TSimpleJSONProtocol 
> ---------------------------------------------
>
>                 Key: THRIFT-1797
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1797
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Python - Library
>    Affects Versions: 1.2
>         Environment: Ubuntu
>            Reporter: Avi Flamholz
>         Attachments: python_simple_json_protocol.patch, 
> python_simple_json_protocol.patch
>
>
> I've attached a patch with a Python implementation of TSimpleJSONProtocol. 
> This protocol is write-only like the Java implementation. It also fixes a bug 
> in TJSONProtocol where the context stack was not being popped correctly. This 
> bug triggered a number of errors in the serialization and deserialization of 
> Thrift structures to JSON.
> The patch also includes a test of TSimpleJSONProtocol. The test checks that 
> it returns sensible results, but does not check that the wire-format is 
> equivalent to the Java wire format.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to