praekelt/vumi — pull request #718 by jerith (2014-02-04 10:07:34+00:00)
Title: USSD transports unhappy after a disconnect.

```
2014-02-01 10:19:08+0000 [Uninitialized] Unhandled Error
Traceback (most recent call last):
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
--- ---
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 619, in _doReadOrWrite
why = selectable.doWrite()
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 593, in doConnect
self._connectDone()
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 612, in _connectDone
self.protocol.makeConnection(self)
exceptions.AttributeError: 'NoneType' object has no attribute 'makeConnection'

2014-02-01 10:19:08+0000 [Uninitialized] Unhandled Error
Traceback (most recent call last):
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/application/app.py", line 313, in runReactorWithLogging
reactor.run()
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/base.py", line 1192, in run
self.mainLoop()
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/base.py", line 1204, in mainLoop
self.doIteration(t)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 396, in doPoll
log.callWithLogger(selectable, _drdw, selectable, fd, event)
--- ---
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/python/log.py", line 88, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 627, in _doReadOrWrite
self._disconnectSelectable(selectable, why, inRead)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 263, in _disconnectSelectable
selectable.connectionLost(failure.Failure(why))
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 485, in connectionLost
self._commonConnection.connectionLost(self, reason)
File "/var/praekelt/vumi-go/ve/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 299, in connectionLost
protocol.connectionLost(reason)
exceptions.AttributeError: 'NoneType' object has no attribute 'connectionLost'

```