Opened 9 years ago

Closed 2 years 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:

Description (last modified by therve)

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

$ python 
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/", 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/", line 73, in callWithContext
    return{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/", 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/", 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/", 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/", 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/", 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/", line 419, in dataReceived
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/", 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/", line 120, in dataReceived
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/", 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/", line 520, in rawDataReceived
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/web/", line 483, in handleResponseEnd
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/web/", line 360, in handleResponse
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/", line 477, in loseConnection
  File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/protocols/", 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()

Change History (4)

comment:1 Changed 9 years ago by therve

Description: modified (diff)

comment:2 Changed 9 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 9 years ago by Jean-Paul Calderone

Author: Andrei Sasu
Priority: highestnormal

comment:4 Changed 2 years 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.