New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crasher in doc_resolv, in js_index.loads #287

Closed
GaelVaroquaux opened this Issue Aug 24, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@GaelVaroquaux
Contributor

GaelVaroquaux commented Aug 24, 2017

Scipy-lectures does not build with latest sphinx-gallery and sphinx 1.4.6. A bit of debugging shows that it is when doc_resolv tries to load the js from statsmodels (http://www.statsmodels.org/stable/searchindex.js).

The full traceback is below.

My hunch is that it is because it is trying to load a searchindex.js generated by a different version of sphinx. However, this hypothesis is not that clear, because the code does not crash with scipy (I inserted print statements to figure this out) and both statsmodels documentation and scipy use sphinx 1.5.3.

Currently this implies that latest sphinx-gallery breaks scipy-lectures. It might break other packages. I believe that this is a blocker for a release (I will need to downgrade to continue working).

Ping @QuLogic (author of #272, that is the origin of the breaks).

Maybe the right thing to do would be use the objects.inv, which are related to the intersphinx mechanism, and hence for which sphinx should implement a backward compatibility.

# Sphinx version: 1.4.6
# Python version: 2.7.12+ (CPython)
# Docutils version: 0.12 release
# Jinja2 version: 2.8
# Last messages:
#   WARNING: html_static_path entry u'/home/varoquau/dev/scipy-lecture-notes/_static' does not exist
#   done
#   copying extra files...
#   done
#   dumping search index in English (code: en) ...
#   done
#   dumping object inventory...
#   done
#   build succeeded, 102 warnings.
#   embedding documentation hyperlinks in examples...
# Loaded extensions:
#   sphinx.ext.autodoc (1.4.6) from /home/varoquau/.local/lib/python2.7/site-packages/sphinx/ext/autodoc.pyc
#   sphinx.ext.intersphinx (1.4.6) from /home/varoquau/.local/lib/python2.7/site-packages/sphinx/ext/intersphinx.pyc
#   sphinx.ext.doctest (1.4.6) from /home/varoquau/.local/lib/python2.7/site-packages/sphinx/ext/doctest.pyc
#   only_directives (unknown version) from /home/varoquau/dev/scipy-lecture-notes/sphinxext/only_directives.pyc
#   sphinx.ext.extlinks (1.4.6) from /home/varoquau/.local/lib/python2.7/site-packages/sphinx/ext/extlinks.pyc
#   plot_directive (unknown version) from /home/varoquau/dev/scipy-lecture-notes/sphinxext/plot_directive.pyc
#   sphinx_gallery.gen_gallery (unknown version) from /home/varoquau/dev/sphinx-gallery/sphinx_gallery/gen_gallery.pyc
#   ipython_console_highlighting (unknown version) from /home/varoquau/dev/scipy-lecture-notes/sphinxext/ipython_console_highlighting.pyc
#   alabaster (0.7.9) from /home/varoquau/.local/lib/python2.7/site-packages/alabaster/__init__.pyc
#   sphinx.ext.imgmath (1.4.6) from /home/varoquau/.local/lib/python2.7/site-packages/sphinx/ext/imgmath.pyc
Traceback (most recent call last):
  File "/home/varoquau/.local/lib/python2.7/site-packages/sphinx/cmdline.py", line 244, in main
    app.build(opts.force_all, filenames)
  File "/home/varoquau/.local/lib/python2.7/site-packages/sphinx/application.py", line 315, in build
    self.emit('build-finished', None)
  File "/home/varoquau/.local/lib/python2.7/site-packages/sphinx/application.py", line 551, in emit
    results.append(callback(self, *args))
  File "/home/varoquau/dev/sphinx-gallery/sphinx_gallery/docs_resolv.py", line 383, in embed_code_links
    _embed_code_links(app, gallery_conf, gallery_dir)
  File "/home/varoquau/dev/sphinx-gallery/sphinx_gallery/docs_resolv.py", line 266, in _embed_code_links
    src_gallery_dir)
  File "/home/varoquau/dev/sphinx-gallery/sphinx_gallery/docs_resolv.py", line 171, in __init__
    self._searchindex = js_index.loads(sindex)
  File "/home/varoquau/.local/lib/python2.7/site-packages/sphinx/search/__init__.py", line 160, in loads
    return jsdump.loads(data)
  File "/home/varoquau/.local/lib/python2.7/site-packages/sphinx/util/jsdump.py", line 187, in loads
    raise ValueError("read error at pos %d" % i)
ValueError: read error at pos 498466
@larsoner

This comment has been minimized.

Contributor

larsoner commented Aug 24, 2017

Maybe the right thing to do would be use the objects.inv, which are related to the intersphinx mechanism, and hence for which sphinx should implement a backward compatibility.

This would also be better because then the URLs supplied to intersphinx and the SG-conf could be the same. Currently they differ for some packages in my use cases.

@QuLogic

This comment has been minimized.

Contributor

QuLogic commented Oct 1, 2017

When I run jsdump.loads from Sphinx 1.6.3 against that file, I get ValueError: bareword as value. Maybe they did some additional optimization of that file themselves?

I would definitely think using intersphinx would be simpler and safer, but I did not have much time to see how to do it.

@larsoner

This comment has been minimized.

Contributor

larsoner commented Oct 2, 2017

PR up at #296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment