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

If you inadvertently try to send without first opening you get a useless exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 0.2
    • Python - Library
    • None
    • Debian x86 linux running hbase, hadoop, Python2.5.4, thrift trunk

    • Patch Available

    Description

      When you accidentally try and cause a send when you don't call open first you get an AttributeError: 'NoneType' object has no attribute 'send'

      Complete traceback:
      AttributeError Traceback (most recent call last)

      /home/dramus/code/wade/wade/model/<ipython console> in <module>()

      /home/dramus/code/wade/wade/model/hbasemodel.py in CreateTable(self)
      30
      31 try:
      ---> 32 self.client.createTable("node", columns)
      33 except ttypes.AlreadyExists, ex:
      34 log.exception(ex.message)

      /home/dramus/code/wade/wade/model/hbase/Hbase.py in createTable(self, tableName, columnFamilies)
      723 - columnFamilies
      724 """
      --> 725 self.send_createTable(tableName, columnFamilies)
      726 self.recv_createTable()
      727

      /home/dramus/code/wade/wade/model/hbase/Hbase.py in send_createTable(self, tableName, columnFamilies)
      733 args.write(self._oprot)
      734 self._oprot.writeMessageEnd()
      --> 735 self._oprot.trans.flush()
      736
      737 def recv_createTable(self, ):

      /home/dramus/code/wade/wade/model/usr/lib/python2.5/site-packages/thrift/transport/TTransport.py in flush(self)

      /home/dramus/code/wade/wade/model/usr/lib/python2.5/site-packages/thrift/transport/TSocket.py in write(self, buff)

      AttributeError: 'NoneType' object has no attribute 'send'

      A more appropriate error message would be to raise a NotConnectedError or something along those lines

      Attachments

        Activity

          People

            dreiss David Reiss
            dramus Michael Robellard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: