Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908377 - dev-python/notebook does not work with dev-python/mistune-3.0.1
Summary: dev-python/notebook does not work with dev-python/mistune-3.0.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-11 13:28 UTC by Harris Landgarten
Modified: 2023-06-12 04:28 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harris Landgarten 2023-06-11 13:28:23 UTC
After the update to dev-python/mistune-3.0.1 jupyter-notebook no longer functions. Trying to run a notebook in a chrome causes an "INTERNAL ERR
OR" message in the browser. Downgrading to 2.0.5 fixes it. The new mistune doesn't break jupyter-lab. Only jupyter-notebook. This is the trace in the console:

Uncaught exception GET /notebooks/accuracy.ipynb (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/accuracy.ipynb', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/tornado/web.py", line 1786, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/tornado/gen.py", line 786, in run
        yielded = self.gen.send(value)
                  ^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/notebook/notebook/handlers.py", line 94, in get
        self.write(self.render_template('notebook.html',
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/notebook/base/handlers.py", line 515, in render_template
        return template.render(**ns)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
        self.environment.handle_exception()
      File "/usr/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
        raise rewrite_traceback_stack(source=source)
      File "/usr/lib/python3.11/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/usr/lib/python3.11/site-packages/notebook/templates/page.html", line 187, in top-level template code
        {% block header %}
      File "/usr/lib/python3.11/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
        {% for exporter in get_frontend_exporters() %}
        ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/notebook/notebook/handlers.py", line 40, in get_frontend_exporters
        for name in get_export_names():
                    ^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/nbconvert/exporters/base.py", line 150, in get_export_names
        e = get_exporter(exporter_name)(config=config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/nbconvert/exporters/base.py", line 109, in get_exporter
        exporter = [e for e in exporters if e.name == name or e.name == name.lower()][0].load()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
        module = import_module(match.group('module'))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 940, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/lib/python3.11/site-packages/nbconvert/__init__.py", line 7, in <module>
        from .exporters import *
      File "/usr/lib/python3.11/site-packages/nbconvert/exporters/__init__.py", line 4, in <module>
        from .html import HTMLExporter
      File "/usr/lib/python3.11/site-packages/nbconvert/exporters/html.py", line 28, in <module>
        from nbconvert.filters.markdown_mistune import IPythonRenderer, MarkdownWithMath
      File "/usr/lib/python3.11/site-packages/nbconvert/filters/markdown_mistune.py", line 17, in <module>
        from mistune import PLUGINS, BlockParser, HTMLRenderer, InlineParser, Markdown  # type:ignore
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ImportError: cannot import name 'PLUGINS' from 'mistune' (/usr/lib/python3.11/site-packages/mistune/__init__.py)
[E 16:26:12.406 NotebookApp] {
      "Host": "localhost:8888",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
    }
[E 16:26:12.406 NotebookApp] 500 GET /notebooks/accuracy.ipynb (::1) 67.080000ms referer=None
Comment 1 Larry the Git Cow gentoo-dev 2023-06-12 04:28:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de294f985a028405be1bc1cc625e7f3e7ea2f548

commit de294f985a028405be1bc1cc625e7f3e7ea2f548
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-06-12 04:22:20 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-12 04:22:20 +0000

    dev-python/nbconvert: fix nbconvert dep on mistune
    
    Incompatible w/ mistune-3, see https://github.com/jupyter/nbconvert/pull/1820.
    
    Closes: https://bugs.gentoo.org/908377
    Signed-off-by: Sam James <sam@gentoo.org>

 .../nbconvert/{nbconvert-7.3.1.ebuild => nbconvert-7.3.1-r1.ebuild}    | 3 ++-
 .../nbconvert/{nbconvert-7.4.0.ebuild => nbconvert-7.4.0-r1.ebuild}    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)