Opened 7 years ago

Closed 10 months ago

#6428 defect closed worksforme (worksforme)

exceptions.TypeError: shutdown() takes exactly 1 argument (0 given)

Reported by: Andrei Sasu Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description (last modified by therve)

I encountered the following error when running the examples in the following code, seems like in twisted/protocols/tls.py shutdown() is not being called properly( expects an int as argument ):

https://github.com/etopian/twisted-xmlrpc-ssl

$ python client.py 
Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/python/log.py", line 88, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/python/log.py", line 73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/internet/tcp.py", line 215, in doRead
    return self._dataReceived(data)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/internet/tcp.py", line 221, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/tls.py", line 419, in dataReceived
    self._flushReceiveBIO()
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/tls.py", line 389, in _flushReceiveBIO
    ProtocolWrapper.dataReceived(self, bytes)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/policies.py", line 120, in dataReceived
    self.wrappedProtocol.dataReceived(data)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/basic.py", line 588, in dataReceived
    why = self.rawDataReceived(data)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/web/http.py", line 520, in rawDataReceived
    self.handleResponseEnd()
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/web/http.py", line 483, in handleResponseEnd
    self.handleResponse(b)
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/web/xmlrpc.py", line 360, in handleResponse
    self.transport.loseConnection()
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/tls.py", line 477, in loseConnection
    self._shutdownTLS()
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/tls.py", line 426, in _shutdownTLS
    shutdownSuccess = self._tlsConnection.shutdown()
exceptions.TypeError: shutdown() takes exactly 1 argument (0 given)
error [Failure instance: Traceback (failure with no frames): <type 'exceptions.TypeError'>: shutdown() takes exactly 1 argument (0 given)
]
422     def _shutdownTLS(self):
423         """
424         Initiate, or reply to, the shutdown handshake of the TLS layer.
425         """
426         shutdownSuccess = self._tlsConnection.shutdown()
427         self._flushSendBIO()
428         if shutdownSuccess:
429             # Both sides have shutdown, so we can start closing lower-level
430             # transport. This will also happen if we haven't started
431             # negotiation at all yet, in which case shutdown succeeds
432             # immediately.
433             self.transport.loseConnection()
434 


Change History (4)

comment:1 Changed 7 years ago by therve

Description: modified (diff)

comment:2 Changed 7 years ago by therve

The error reads a bit differently than what you said: it means that self was not passed, maybe because tlsConnection is a class instead of being an instance or something. What's your version of pyopenssl?

The server also uses web2, which is not supported anymore so it may be an issue.

comment:3 Changed 7 years ago by Jean-Paul Calderone

Author: Andrei Sasu
Priority: highestnormal

comment:4 Changed 10 months ago by Glyph

Resolution: worksforme
Status: newclosed

I can't reproduce this issue and web2 doesn't exist any more, so I'm going to close this.

Note: See TracTickets for help on using tickets.