Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Transport is_open() doesn't return False after closure #230

Closed
gorlins opened this issue Aug 25, 2016 · 1 comment
Closed

Transport is_open() doesn't return False after closure #230

gorlins opened this issue Aug 25, 2016 · 1 comment

Comments

@gorlins
Copy link

gorlins commented Aug 25, 2016

Version 0.3.8 python 2.7, transport.close() either does not close the transport or incorrectly returns its status

from thriftpy.thrift import TClient
from thriftpy.transport import TFramedTransport, TSocket
from thriftpy.protocol import TCompactProtocol

_transport_class = TFramedTransport
_protocol_class = TCompactProtocol

socket = TSocket(host, port)
transport = _transport_class(socket)
protocol = _protocol_class(transport, decode_response=False)

print 'Transport open:', transport.is_open() # False
transport.open()
print 'Transport open:', transport.is_open() # True
transport.close()
print 'Transport open:', transport.is_open() # True!!
transport.open()
print 'Transport open:', transport.is_open() # True

python-happybase/happybase#133

@gorlins
Copy link
Author

gorlins commented Aug 26, 2016

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant