Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 905102 - dev-python/notebook-6.4.12 fails tests: "ValueError: No template sub-directory with name 'latex' found in the following paths:"
Summary: dev-python/notebook-6.4.12 fails tests: "ValueError: No template sub-director...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
Depends on:
Reported: 2023-04-26 03:53 UTC by Jonathan Lovelace
Modified: 2023-08-05 06:12 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

dev-python:notebook-6.4.12:20230426-033549.log (build.log,461.43 KB, text/x-log)
2023-04-26 04:08 UTC, Jonathan Lovelace
emerge-info.txt (emerge-info.txt,9.09 KB, text/plain)
2023-04-26 04:09 UTC, Jonathan Lovelace

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Lovelace 2023-04-26 03:53:12 UTC
=dev-python/notebook-6.4.12 fails its test phase for me. (I've also believe I've tried all the later versions in the tree, with similar results, but knowing which versions of which dependencies to add to package.accept_keywords is tricky enough I hesitate to specify one of those versions in the title of the bug.) Six tests in notebook/nbconvert/tests/ fail with "requests.exceptions.HTTPError: 500 Server Error: Intern..." (except one failing with an AssertionError because it got a 500 instead of a 404 error). The cause of these 500 errors is plain from the "captured log calls", such as the following:

DEBUG Accepting token-authenticated connection from
WARNING Notebook foo/testnb.ipynb is not trusted
DEBUG 200 GET /a%40b/api/contents/foo/testnb.ipynb ( 5.240000ms
DEBUG Accepting token-authenticated connection from
ERROR Uncaught exception POST /a%40b/nbconvert/latex (
HTTPServerRequest(protocol='http', host='localhost:12341', method='POST', uri='/a%40b/nbconvert/latex', version='HTTP/1.1', remote_ip='
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/traitlets/", line 656, in get
    value = obj._trait_values[]
KeyError: 'template_paths'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/tornado/", line 1711, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/usr/lib/python3.10/site-packages/tornado/", line 3208, in wrapper
    return method(self, *args, **kwargs)
  File "/var/tmp/portage/dev-python/notebook-6.4.12/work/notebook-6.4.12/notebook/nbconvert/", line 164, in post
    exporter = get_exporter(format, config=self.config)
  File "/var/tmp/portage/dev-python/notebook-6.4.12/work/notebook-6.4.12/notebook/nbconvert/", line 67, in get_exporter
    Exporter = get_exporter(format)
  File "/usr/lib/python3.10/site-packages/nbconvert/exporters/", line 110, in get_exporter
    if getattr(exporter(config=config), "enabled", True):
  File "/usr/lib/python3.10/site-packages/nbconvert/exporters/", line 348, in __init__
    super().__init__(config=config, **kw)
  File "/usr/lib/python3.10/site-packages/nbconvert/exporters/", line 122, in __init__
  File "/usr/lib/python3.10/site-packages/nbconvert/exporters/", line 528, in _init_preprocessors
    conf = self._get_conf()
  File "/usr/lib/python3.10/site-packages/nbconvert/exporters/", line 546, in _get_conf
    for path in map(Path, self.template_paths):
  File "/usr/lib/python3.10/site-packages/traitlets/", line 703, in __get__
    return self.get(obj, cls)
  File "/usr/lib/python3.10/site-packages/traitlets/", line 659, in get
    default = obj.trait_defaults(
  File "/usr/lib/python3.10/site-packages/traitlets/", line 1872, in trait_defaults
    return self._get_trait_default_generator(names[0])(self)
  File "/usr/lib/python3.10/site-packages/traitlets/", line 1233, in __call__
    return self.func(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/nbconvert/exporters/", line 557, in _template_paths
    template_names = self.get_template_names()
  File "/usr/lib/python3.10/site-packages/nbconvert/exporters/", line 642, in get_template_names
    raise ValueError(
ValueError: No template sub-directory with name 'latex' found in the following paths:
DEBUG Using contents: services/contents
DEBUG Using contents: services/contents
  "Host": "localhost:12341",
  "Accept": "*/*",
  "User-Agent": "python-requests/2.28.2"
ERROR 500 POST /a%40b/nbconvert/latex ( 62.730000ms referer=None
Comment 1 Jonathan Lovelace 2023-04-26 04:08:40 UTC
Created attachment 860776 [details]
Comment 2 Jonathan Lovelace 2023-04-26 04:09:07 UTC
Created attachment 860777 [details]
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-08-05 06:12:52 UTC
I've looked into it and I think that it's notebook 6.x doing something stupid that replaces /usr/share with <tempdir>/share in the test suite.  I can't reproduce the failure with 7.x, so I don't think it's worth spending more time on it.