# Buggy code
def build(self, force_all=False, filenames=None):
    # type: (bool, List[unicode]) -> None
    try:
        if force_all:
            self.builder.compile_all_catalogs()
            self.builder.build_all()
        elif filenames:
            self.builder.compile_specific_catalogs(filenames)
            self.builder.build_specific(filenames)
        else:
            self.builder.compile_update_catalogs()
            self.builder.build_update()

        status = (
            self.statuscode == 0 and __("succeeded") or __("finished with problems")
        )
        if self._warncount:
            logger.info(
                bold(
                    __(
                        "build %s, %s warning.",
                        "build %s, %s warnings.",
                        self._warncount,
                    )
                    % (status, self._warncount)
                )
            )
        else:
            logger.info(bold(__("build %s.") % status))

        if self.statuscode == 0 and self.builder.epilog:
            logger.info("")
            logger.info(
                self.builder.epilog
                % {"outdir": path.relpath(self.outdir), "project": self.config.project}
            )
    except Exception as err:
        # delete the saved env to force a fresh build next time
        envfile = path.join(self.doctreedir, ENV_PICKLE_FILENAME)
        if path.isfile(envfile):
            os.unlink(envfile)
        self.emit("build-finished", err)
        raise
    else:
        self.emit("build-finished", None)
    self.builder.cleanup()


# Traceback (ValueError)
sphinx-err-847fe2th.log

# Sphinx version: 1.7.2
# Python version: 3.6.5rc1 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
#   done
#
#   dumping object inventory...
#
#   done
#
#   build succeeded.
#
#
#
# Loaded extensions:
#   alabaster (0.7.10) from c:\users\user\appdata\local\programs\python\python36\lib\site-packages\alabaster\__init__.py
Traceback (most recent call last):
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\sphinx\cmdline.py", line 304, in main
app.build(args.force_all, filenames)
File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\sphinx\application.py", line 345, in build
'outdir': path.relpath(self.outdir),
File "c:\users\user\appdata\local\programs\python\python36\lib\ntpath.py", line 586, in relpath
path_drive, start_drive))
ValueError: path is on mount 'C:', start on mount 'D:'

# Fixed code
def build(self, force_all=False, filenames=None):
    # type: (bool, List[unicode]) -> None
    try:
        if force_all:
            self.builder.compile_all_catalogs()
            self.builder.build_all()
        elif filenames:
            self.builder.compile_specific_catalogs(filenames)
            self.builder.build_specific(filenames)
        else:
            self.builder.compile_update_catalogs()
            self.builder.build_update()

        status = (
            self.statuscode == 0 and __("succeeded") or __("finished with problems")
        )
        if self._warncount:
            logger.info(
                bold(
                    __(
                        "build %s, %s warning.",
                        "build %s, %s warnings.",
                        self._warncount,
                    )
                    % (status, self._warncount)
                )
            )
        else:
            logger.info(bold(__("build %s.") % status))

        if self.statuscode == 0 and self.builder.epilog:
            logger.info("")
            logger.info(
                self.builder.epilog
                % {"outdir": relpath(self.outdir), "project": self.config.project}
            )
    except Exception as err:
        # delete the saved env to force a fresh build next time
        envfile = path.join(self.doctreedir, ENV_PICKLE_FILENAME)
        if path.isfile(envfile):
            os.unlink(envfile)
        self.emit("build-finished", err)
        raise
    else:
        self.emit("build-finished", None)
    self.builder.cleanup()