Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3323

Python library does not handle escaped forward slash ("/") in JSON

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9.2
    • 0.10.0
    • Python - Library
    • None

    Description

      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

      Attachments

        Activity

          People

            jensg Jens Geyer
            subratbasnet Subrat Basnet
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: