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

Jens Geyer commented on THRIFT-3323:
------------------------------------

GitHub user grepsr opened a pull request:

    https://github.com/apache/thrift/pull/605

    Update TJSONProtocol.py

    According to JSON spec a forward slash "/" may be escaped too; and when 
that happened, it triggered an issue with deserializing the object.
    
    This small fix addresses that.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/grepsr/thrift master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/605.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #605
    
----
commit 68b19846dddcd455a36fa49907d671bf6069fffa
Author: Grepsr <i...@grepsr.com>
Date:   2015-09-13T17:01:17Z

    Update TJSONProtocol.py
    
    According to JSON spec a forward slash "/" may be escaped too; and when 
that happened, it triggered an issue with deserializing the object.
    
    This small fix addresses that.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


> Python library does not handle escaped forward slash ("/") in JSON
> ------------------------------------------------------------------
>
>                 Key: THRIFT-3323
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3323
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Library
>    Affects Versions: 0.9.2
>            Reporter: Subrat Basnet
>            Priority: Minor
>
> As per json.org - a slash ("/") may be escaped too.
> When parsing a JSON that has escaped slashes, the Python library throws an 
> exception as follows:
> Traceback (most recent call last):
>   File "lib/crawldata.py", line 32, in __init__
>     deserialize(base=self, buf=thrift_buf, 
> protocol_factory=CrawlDataTJSONProtocolFactory())
>   File "/usr/local/lib/python2.7/dist-packages/thrift/TSerialization.py", 
> line 37, in deserialize
>     base.read(protocol)
>   File "models/thrift/crawldata/ttypes.py", line 761, in read
>     self.data.read(iprot)
>   File "models/thrift/crawldata/ttypes.py", line 241, in read
>     _val19 = iprot.readString();
>   File 
> "/usr/local/lib/python2.7/dist-packages/thrift/protocol/TJSONProtocol.py", 
> line 390, in readString
>     return self.readJSONString(False)
>   File 
> "/usr/local/lib/python2.7/dist-packages/thrift/protocol/TJSONProtocol.py", 
> line 235, in readJSONString
>     "Expected control char")
> TProtocolException: Expected control char



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to