[ 
https://issues.apache.org/jira/browse/THRIFT-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bryan Duxbury closed THRIFT-495.
--------------------------------

    Assignee: David Reiss

> If you inadvertently try to send without first opening you get a useless 
> exception
> ----------------------------------------------------------------------------------
>
>                 Key: THRIFT-495
>                 URL: https://issues.apache.org/jira/browse/THRIFT-495
>             Project: Thrift
>          Issue Type: Bug
>          Components: Library (Python)
>         Environment: Debian x86 linux running hbase, hadoop, Python2.5.4, 
> thrift trunk
>            Reporter: Michael Robellard
>            Assignee: David Reiss
>            Priority: Trivial
>             Fix For: 0.2
>
>         Attachments: 
> 0001-THRIFT-495.-python-Raise-a-TTransportException-if-T.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to