def dump(self, password, db, format_='zip'):
        """Backup the `db` database. Returns the dump as a binary ZIP file
        containing the SQL dump file alongside the filestore directory (if any).

        >>> dump = odoo.db.dump('super_admin_passwd', 'prod') # doctest: +SKIP

        .. doctest::
            :hide:

            >>> dump = odoo.db.dump(SUPER_PWD, DB)

        If you get a timeout error, increase this one before performing the
        request:

        >>> timeout_backup = odoo.config['timeout']
        >>> odoo.config['timeout'] = 600    # Timeout set to 10 minutes
        >>> dump = odoo.db.dump('super_admin_passwd', 'prod')   # doctest: +SKIP
        >>> odoo.config['timeout'] = timeout_backup

        Write it on the file system:

        .. doctest::
            :options: +SKIP

            >>> with open('dump.zip', 'wb') as dump_zip:
            ...     dump_zip.write(dump.read())
            ...

        .. doctest::
            :hide:

            >>> with open('dump.zip', 'wb') as dump_zip:
            ...     fileno = dump_zip.write(dump.read())    # Python 3
            ...

        You can manipulate the file with the `zipfile` module for instance:

        .. doctest::
            :options: +SKIP

            >>> import zipfile
            >>> zipfile.ZipFile('dump.zip').namelist()
            ['dump.sql',
            'filestore/ef/ef2c882a36dbe90fc1e7e28d816ad1ac1464cfbb',
            'filestore/dc/dcf00aacce882bbfd117c0277e514f829b4c5bf0',
             ...]

        .. doctest::
            :hide:

            >>> import zipfile
            >>> zipfile.ZipFile('dump.zip').namelist() # doctest: +NORMALIZE_WHITESPACE
            ['dump.sql'...'filestore/...'...]

        The super administrator password is required to perform this method.

        *Python 2:*

        :return: `io.BytesIO`
        :raise: :class:`odoorpc.error.RPCError` (access denied / wrong database)
        :raise: `urllib2.URLError` (connection error)

        *Python 3:*

        :return: `io.BytesIO`
        :raise: :class:`odoorpc.error.RPCError` (access denied / wrong database)
        :raise: `urllib.error.URLError` (connection error)
        """
        args = [password, db]
        if v(self._odoo.version)[0] >= 9:
            args.append(format_)
        data = self._odoo.json(
            '/jsonrpc',
            {'service': 'db',
             'method': 'dump',
             'args': args})
        # Encode to bytes forced to be compatible with Python 3.2
        # (its 'base64.standard_b64decode()' function only accepts bytes)
        result = encode2bytes(data['result'])
        content = base64.standard_b64decode(result)
        return io.BytesIO(content)