# Buggy code
def provide_context_and_uptodate(self, cat, lang, node=None):
    """Provide data for the context and the uptodate list for the list of the given classifiation."""
    cat_path = self.extract_hierarchy(cat)
    kw = {
        "category_path": self.site.config["CATEGORY_PATH"],
        "category_prefix": self.site.config["CATEGORY_PREFIX"],
        "category_pages_are_indexes": self.site.config["CATEGORY_PAGES_ARE_INDEXES"],
        "tzinfo": self.site.tzinfo,
        "category_pages_descriptions": self.site.config["CATEGORY_PAGES_DESCRIPTIONS"],
        "category_pages_titles": self.site.config["CATEGORY_PAGES_TITLES"],
    }
    posts = self.site.posts_per_classification[self.classification_name][lang]
    children = [
        child
        for child in node.children
        if len(
            [
                post
                for post in posts.get(child.classification_name, [])
                if self.site.config["SHOW_UNTRANSLATED_POSTS"]
                or post.is_translation_available(lang)
            ]
        )
        > 0
    ]
    subcats = [
        (
            child.name,
            self.site.link(self.classification_name, child.classification_name, lang),
            child.classification_name,
            child.classification_path,
        )
        for child in children
    ]
    friendly_name = self.get_classification_friendly_name(cat, lang)
    context = {
        "title": self.site.config["CATEGORY_PAGES_TITLES"]
        .get(lang, {})
        .get(cat, self.site.MESSAGES[lang]["Posts about %s"] % friendly_name),
        "description": self.site.config["CATEGORY_PAGES_DESCRIPTIONS"]
        .get(lang, {})
        .get(cat),
        "kind": "category",
        "pagekind": ["tag_page", "index" if self.show_list_as_index else "list"],
        "tag": friendly_name,
        "category": cat,
        "category_path": cat_path,
        "subcategories": subcats,
    }
    if self.show_list_as_index:
        context["rss_link"] = (
            """<link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag {0} ({1})" href="{2}">""".format(
                friendly_name, lang, self.site.link("category_rss", cat, lang)
            )
        )
    kw.update(context)
    return context, kw


# Traceback (ValueError)
TaskError - taskid:render_taxonomies:output/categories/cat_code/index.html
PythonAction Error
Traceback (most recent call last):
File "/home/denin/Workspace/nikola/nikola3/lib/python3.5/site-packages/doit/action.py", line 403, in execute
returned_value = self.py_callable(*self.args, **kwargs)
File "/home/denin/Workspace/nikola/nikola3/lib/python3.5/site-packages/nikola/nikola.py", line 1396, in render_template
template_name, None, local_context)
File "/home/denin/Workspace/nikola/nikola3/lib/python3.5/site-packages/nikola/plugins/template/mako.py", line 117, in render_template
data = template.render_unicode(**context)
File "/home/denin/Workspace/nikola/nikola3/lib/python3.5/site-packages/mako/template.py", line 471, in render_unicode
as_unicode=True)
File "/home/denin/Workspace/nikola/nikola3/lib/python3.5/site-packages/mako/runtime.py", line 838, in _render
**_kwargs_for_callable(callable_, data))
File "/home/denin/Workspace/nikola/nikola3/lib/python3.5/site-packages/mako/runtime.py", line 873, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/home/denin/Workspace/nikola/nikola3/lib/python3.5/site-packages/mako/runtime.py", line 899, in _exec_template
callable_(context, *args, **kwargs)
File "/home/denin/Workspace/nikola/nikola3/my_first_site/cache/.mako.tmp/base.tmpl.py", line 127, in render_body
context['self'].content(**pageargs)
File "/home/denin/Workspace/nikola/nikola3/my_first_site/cache/.mako.tmp/tag.tmpl.py", line 137, in render_content
for name, link in subcategories:
ValueError: too many values to unpack (expected 2)

# Fixed code
def provide_context_and_uptodate(self, cat, lang, node=None):
    """Provide data for the context and the uptodate list for the list of the given classifiation."""
    cat_path = self.extract_hierarchy(cat)
    kw = {
        "category_path": self.site.config["CATEGORY_PATH"],
        "category_prefix": self.site.config["CATEGORY_PREFIX"],
        "category_pages_are_indexes": self.site.config["CATEGORY_PAGES_ARE_INDEXES"],
        "tzinfo": self.site.tzinfo,
        "category_pages_descriptions": self.site.config["CATEGORY_PAGES_DESCRIPTIONS"],
        "category_pages_titles": self.site.config["CATEGORY_PAGES_TITLES"],
    }
    posts = self.site.posts_per_classification[self.classification_name][lang]
    children = [
        child
        for child in node.children
        if len(
            [
                post
                for post in posts.get(child.classification_name, [])
                if self.site.config["SHOW_UNTRANSLATED_POSTS"]
                or post.is_translation_available(lang)
            ]
        )
        > 0
    ]
    subcats = [
        (
            child.name,
            self.site.link(self.classification_name, child.classification_name, lang),
        )
        for child in children
    ]
    friendly_name = self.get_classification_friendly_name(cat, lang)
    context = {
        "title": self.site.config["CATEGORY_PAGES_TITLES"]
        .get(lang, {})
        .get(cat, self.site.MESSAGES[lang]["Posts about %s"] % friendly_name),
        "description": self.site.config["CATEGORY_PAGES_DESCRIPTIONS"]
        .get(lang, {})
        .get(cat),
        "kind": "category",
        "pagekind": ["tag_page", "index" if self.show_list_as_index else "list"],
        "tag": friendly_name,
        "category": cat,
        "category_path": cat_path,
        "subcategories": subcats,
    }
    if self.show_list_as_index:
        context["rss_link"] = (
            """<link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag {0} ({1})" href="{2}">""".format(
                friendly_name, lang, self.site.link("category_rss", cat, lang)
            )
        )
    kw.update(context)
    return context, kw