'This method returns a DeferredList.'

def _openDataConnection(self, commands, protocol):

    cmds = [FTPCommand(command, public=1) for command in commands]
    cmdsDeferred = defer.DeferredList([cmd.deferred for cmd in cmds], fireOnOneErrback=True, consumeErrors=True)
    cmdsDeferred.addErrback(_unwrapFirstError)
    if self.passive:
        _mutable = [None]
        def doPassive(response):
            'Connect    to    the    port    specified    in    the    response    to    PASV'
            (host, port) = decodeHostPort(response[(-1)][4:])
            f = _PassiveConnectionFactory(protocol)
            _mutable[0] = self.connectFactory(host, port, f)
        pasvCmd = FTPCommand('PASV')
        self.queueCommand(pasvCmd)
        pasvCmd.deferred.addCallback(doPassive).addErrback(self.fail)
        results = [cmdsDeferred, pasvCmd.deferred, protocol.deferred]
        d = defer.DeferredList(results, fireOnOneErrback=True, consumeErrors=True)
        d.addErrback(_unwrapFirstError)
        def close(x, m=_mutable):
            (m[0] and m[0].disconnect())
            return x
        d.addBoth(close)
    else:
        portCmd = FTPCommand('PORT')
        portCmd.transferDeferred = protocol.deferred
        portCmd.protocol = protocol
        portCmd.deferred.addErrback(portCmd.transferDeferred.errback)
        self.queueCommand(portCmd)
        portCmd.loseConnection = (lambda result: result)
        portCmd.fail = (lambda error: error)
        cmdsDeferred.addErrback((lambda e, pc=portCmd: (pc.fail(e) or e)))
        results = [cmdsDeferred, portCmd.deferred, portCmd.transferDeferred]
        d = defer.DeferredList(results, fireOnOneErrback=True, consumeErrors=True)
        d.addErrback(_unwrapFirstError)
    for cmd in cmds:
        self.queueCommand(cmd)
    return d
