[ https://issues.apache.org/jira/browse/THRIFT-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14342261#comment-14342261 ]
Roger Meier commented on THRIFT-3002: ------------------------------------- do you have a test case for test/py/ to reproduce it? > Python loops forever with TZlibTransport and TFileObjectTransport > ----------------------------------------------------------------- > > Key: THRIFT-3002 > URL: https://issues.apache.org/jira/browse/THRIFT-3002 > Project: Thrift > Issue Type: Bug > Components: Python - Library > Affects Versions: 0.9.2 > Environment: Ubuntu Linux > Reporter: Tom Hunt > Labels: easyfix > Attachments: TZlibTransport.patch > > > When using a TZlibTransport wrapping a TFileObjectTransport, at end of file > the TZlibTransport loops forever instead of doing anything sensible. This is > because the TZlibTransport does not check for 0-length reads itself and calls > TFileObjectTransport.read() rather than TFileObjectTransport.readAll() (the > latter does its own checking and raises EOFError()). Thus, TZlibTransport > spins forever on 0-length reads and hangs the program. Suggested fix: make > TZlibTransport call readAll() instead of read() in its readComp() method, or > check for 0-length reads on its own and raise EOFError(). -- This message was sent by Atlassian JIRA (v6.3.4#6332)