You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Michael Robellard (JIRA)" <ji...@apache.org> on 2009/05/10 18:02:45 UTC

[jira] Created: (THRIFT-495) If you inadvertently try to send without first opening you get a useless exception

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
            Priority: Trivial


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.


[jira] Updated: (THRIFT-495) If you inadvertently try to send without first opening you get a useless exception

Posted by "Michael Robellard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Robellard updated THRIFT-495:
-------------------------------------

    Patch Info: [Patch Available]

Index: TSocket.py
===================================================================
--- TSocket.py  (revision 773121)
+++ TSocket.py  (working copy)
@@ -95,6 +95,8 @@
     return buff

   def write(self, buff):
+    if not self.handle:
+      raise socket.error('Client not Connected')
     sent = 0
     have = len(buff)
     while sent < have:


> 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
>            Priority: Trivial
>
> 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.


[jira] Commented: (THRIFT-495) If you inadvertently try to send without first opening you get a useless exception

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707875#action_12707875 ] 

David Reiss commented on THRIFT-495:
------------------------------------

How's this?

> 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
>            Priority: Trivial
>         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.


[jira] Resolved: (THRIFT-495) If you inadvertently try to send without first opening you get a useless exception

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Reiss resolved THRIFT-495.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 0.2

> 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
>            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.


[jira] Closed: (THRIFT-495) If you inadvertently try to send without first opening you get a useless exception

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Commented: (THRIFT-495) If you inadvertently try to send without first opening you get a useless exception

Posted by "Michael Robellard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708297#action_12708297 ] 

Michael Robellard commented on THRIFT-495:
------------------------------------------

Looks appropriate to me

traceback now reports:
/home/dramus/code/wade/wade/model/<ipython console> in <module>()

/home/dramus/code/wade/wade/model/hbasemodel.py in CreateTable(self)
     31
     32         try:
---> 33             self.client.createTable("node", columns)
     34         except ttypes.AlreadyExists, ex:
     35             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)

/usr/lib/python2.5/site-packages/thrift/transport/TSocket.py in write(self, buff)
     97   def write(self, buff):
     98     if not self.handle:
---> 99       raise TTransportException(TTransportException.NOT_OPEN, 'Transport not open')
    100     sent = 0
    101     have = len(buff)

TTransportException: Transport not open



> 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
>            Priority: Trivial
>         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.


[jira] Updated: (THRIFT-495) If you inadvertently try to send without first opening you get a useless exception

Posted by "David Reiss (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Reiss updated THRIFT-495:
-------------------------------

    Attachment: 0001-THRIFT-495.-python-Raise-a-TTransportException-if-T.patch

> 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
>            Priority: Trivial
>         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.