# Buggy code
def setup(app: Sphinx) -> Dict[str, Any]:
    app.add_builder(Epub3Builder)

    # config values
    app.add_config_value(
        "epub_basename", lambda self: make_filename(self.project), None
    )
    app.add_config_value("epub_version", 3.0, "epub")  # experimental
    app.add_config_value("epub_theme", "epub", "epub")
    app.add_config_value("epub_theme_options", {}, "epub")
    app.add_config_value("epub_title", lambda self: self.project, "epub")
    app.add_config_value("epub_author", lambda self: self.author, "epub")
    app.add_config_value("epub_language", lambda self: self.language or "en", "epub")
    app.add_config_value("epub_publisher", lambda self: self.author, "epub")
    app.add_config_value("epub_copyright", lambda self: self.copyright, "epub")
    app.add_config_value("epub_identifier", "unknown", "epub")
    app.add_config_value("epub_scheme", "unknown", "epub")
    app.add_config_value("epub_uid", "unknown", "env")
    app.add_config_value("epub_cover", (), "env")
    app.add_config_value("epub_guide", (), "env")
    app.add_config_value("epub_pre_files", [], "env")
    app.add_config_value("epub_post_files", [], "env")
    app.add_config_value("epub_css_files", lambda config: config.html_css_files, "epub")
    app.add_config_value("epub_exclude_files", [], "env")
    app.add_config_value("epub_tocdepth", 3, "env")
    app.add_config_value("epub_tocdup", True, "env")
    app.add_config_value("epub_tocscope", "default", "env")
    app.add_config_value("epub_fix_images", False, "env")
    app.add_config_value("epub_max_image_width", 0, "env")
    app.add_config_value("epub_show_urls", "inline", "epub")
    app.add_config_value("epub_use_index", lambda self: self.html_use_index, "epub")
    app.add_config_value("epub_description", "unknown", "epub")
    app.add_config_value("epub_contributor", "unknown", "epub")
    app.add_config_value(
        "epub_writing_mode", "horizontal", "epub", ENUM("horizontal", "vertical")
    )

    # event handlers
    app.connect("config-inited", convert_epub_css_files)
    app.connect("builder-inited", validate_config_values)

    return {
        "version": "builtin",
        "parallel_read_safe": True,
        "parallel_write_safe": True,
    }


# Traceback (ValueError)
# Sphinx version: 2.0.1
# Python version: 3.7.6 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.11.1
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/sphinx/cmd/build.py", line 283, in build_main
args.tags, args.verbosity, args.jobs, args.keep_going)
File "/usr/lib/python3.7/site-packages/sphinx/application.py", line 260, in __init__
self._init_builder()
File "/usr/lib/python3.7/site-packages/sphinx/application.py", line 321, in _init_builder
self.emit('builder-inited')
File "/usr/lib/python3.7/site-packages/sphinx/application.py", line 440, in emit
return self.events.emit(event, self, *args)
File "/usr/lib/python3.7/site-packages/sphinx/events.py", line 76, in emit
results.append(callback(*args))
File "/usr/lib/python3.7/site-packages/sphinx/ext/intersphinx.py", line 207, in load_mappings
for key, (name, (uri, invs)) in app.config.intersphinx_mapping.items():
ValueError: too many values to unpack (expected 2)

# Fixed code
def setup(app: Sphinx) -> Dict[str, Any]:
    app.add_builder(Epub3Builder)

    # config values
    app.add_config_value(
        "epub_basename", lambda self: make_filename(self.project), None
    )
    app.add_config_value("epub_version", 3.0, "epub")  # experimental
    app.add_config_value("epub_theme", "epub", "epub")
    app.add_config_value("epub_theme_options", {}, "epub")
    app.add_config_value("epub_title", lambda self: self.project, "epub")
    app.add_config_value("epub_author", lambda self: self.author, "epub")
    app.add_config_value("epub_language", lambda self: self.language or "en", "epub")
    app.add_config_value("epub_publisher", lambda self: self.author, "epub")
    app.add_config_value("epub_copyright", lambda self: self.copyright, "epub")
    app.add_config_value("epub_identifier", "unknown", "epub")
    app.add_config_value("epub_scheme", "unknown", "epub")
    app.add_config_value("epub_uid", "unknown", "env")
    app.add_config_value("epub_cover", (), "env")
    app.add_config_value("epub_guide", (), "env")
    app.add_config_value("epub_pre_files", [], "env")
    app.add_config_value("epub_post_files", [], "env")
    app.add_config_value("epub_css_files", lambda config: config.html_css_files, "epub")
    app.add_config_value("epub_exclude_files", [], "env")
    app.add_config_value("epub_tocdepth", 3, "env")
    app.add_config_value("epub_tocdup", True, "env")
    app.add_config_value("epub_tocscope", "default", "env")
    app.add_config_value("epub_fix_images", False, "env")
    app.add_config_value("epub_max_image_width", 0, "env")
    app.add_config_value("epub_show_urls", "inline", "epub")
    app.add_config_value("epub_use_index", lambda self: self.html_use_index, "epub")
    app.add_config_value("epub_description", "unknown", "epub")
    app.add_config_value("epub_contributor", "unknown", "epub")
    app.add_config_value(
        "epub_writing_mode", "horizontal", "epub", ENUM("horizontal", "vertical")
    )

    # event handlers
    app.connect("config-inited", convert_epub_css_files, priority=800)
    app.connect("builder-inited", validate_config_values)

    return {
        "version": "builtin",
        "parallel_read_safe": True,
        "parallel_write_safe": True,
    }