Skip to content
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

sphinx fails to generate html when using remote images with docutils 0.13 [SF:bugs:301] #372

Closed
chrisjsewell opened this issue Aug 9, 2020 · 0 comments

Comments

@chrisjsewell
Copy link
Owner

author: flaper87
created: 2016-12-11 14:36:03.918000
assigned: None
SF_url: https://sourceforge.net/p/docutils/bugs/301

docutils 0.13.1 breaks on remote images

Steps to reproduce:

$ git clone https://github.com/openstack/tripleo-common.git
$ vim README.rst # (remove the :remote: tag)
$ tox -edocs

Line 903 (body of depart_image) is commented here: https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/writers/_html_base.py

Uncommenting that line seems to fix the problem. This has broken several CI jobs for us (OpenStack) as it used to work in previous versions (0.12.0).

Traceback (most recent call last):
  File "setup.py", line 29, in <module>
    pbr=True)
  File "/usr/lib64/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/pbr/builddoc.py", line 198, in run
    setup_command.BuildDoc.run(self)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/sphinx/setup_command.py", line 164, in run
    app.build(force_all=self.all_files)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/sphinx/application.py", line 261, in build
    self.builder.build_all()
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 211, in build_all
    self.build(None, summary='all source files', method='all')
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 322, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 360, in write
    self._write_serial(sorted(docnames), warnings)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/sphinx/builders/__init__.py", line 368, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/sphinx/builders/html.py", line 443, in write_doc
    self.docwriter.write(doctree, destination)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/sphinx/writers/html.py", line 53, in translate
    self.document.walkabout(visitor)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/docutils/nodes.py", line 187, in walkabout
    visitor.dispatch_departure(self)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/docutils/nodes.py", line 1895, in dispatch_departure
    return method(node)
  File "/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/lib/python3.5/site-packages/docutils/writers/_html_base.py", line 671, in depart_document
    assert not self.context, 'len(context) = %s' % len(self.context)
AssertionError: len(context) = 1
ERROR: InvocationError: '/home/flaper87/workspace/openstack/tripleo-common/.tox/docs/bin/python setup.py build_sphinx'

commenter: hcauwelier
posted: 2016-12-12 14:41:56.957000
title: #301 sphinx fails to generate html when using remote images with docutils 0.13

attachments:

Hi,

I was going to report the same issue but in fact it happens with local SVG files and the traceback is not exactly the same. I only get it within a Sphinx environment with references to SVG images.

Example with test.rst:

.. image:: test.svg

The SVG file itself is just empty, a "touch test.svg".

Then I create a Sphinx environment using "sphinx-quickstart".

With "make html", I get the traceback I attach to my comment.

If I comment the ".. image::" directive, or if I install "docutils==0.12", the issue disappears and the docs compile fine.


commenter: tk0miya
posted: 2016-12-12 17:05:51.276000
title: #301 sphinx fails to generate html when using remote images with docutils 0.13

This was already fixed at sphinx side.
sphinx-doc/sphinx#3212

This is not a bug of docutils, I believe.


commenter: milde
posted: 2016-12-13 20:12:18.545000
title: #301 sphinx fails to generate html when using remote images with docutils 0.13

  • labels: --> sphinx
  • summary: docutils fails to generate html when using remote images --> sphinx fails to generate html when using remote images with docutils 0.13
  • status: open --> closed-fixed

commenter: milde
posted: 2016-12-13 20:12:18.710000
title: #301 sphinx fails to generate html when using remote images with docutils 0.13

Fixed by Sphinx 1.5.1 released today. Closing now.

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

No branches or pull requests

1 participant