Skip to content

Conversation

@mythsmith
Copy link

Prevent this kind of error:

# Platform:         linux; (Linux-5.15.0-126-generic-x86_64-with-glibc2.35)
# Sphinx version:   7.2.6
# Python version:   3.10.12 (CPython)
# Docutils version: 0.20.1
# Jinja2 version:   3.1.2
# Pygments version: 2.17.2

# Last messages:
#   mdf/acquisition/fleximeter
#   mdf/browser/browser
#   mdf/graphics/index
#   mdf/graphics/graphics
#   mdf/graphics/navigator
#   mdf/graphics/fleximeter-correction
#   mdf/graphics/coupling-temperature
#   mdf/support/support
#   resolving references...
#   rendering...

# Loaded extensions:
#   sphinx.ext.mathjax (7.2.6)
#   alabaster (0.7.13)
#   sphinxcontrib.applehelp (1.0.7)
#   sphinxcontrib.devhelp (1.0.5)
#   sphinxcontrib.htmlhelp (2.0.4)
#   sphinxcontrib.serializinghtml (1.1.9)
#   sphinxcontrib.qthelp (1.0.6)
#   rinoh.frontend.sphinx (0.5.5)

# Traceback:
Traceback (most recent call last):
  File "/home/daniele/.local/lib/python3.10/site-packages/sphinx/cmd/build.py", line 298, in build_main
    app.build(args.force_all, args.filenames)
  File "/home/daniele/.local/lib/python3.10/site-packages/sphinx/application.py", line 355, in build
    self.builder.build_update()
  File "/home/daniele/.local/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 290, in build_update
    self.build(['__all__'], to_build)
  File "/home/daniele/.local/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 363, in build
    self.write(docnames, list(updated_docnames), method)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/frontend/sphinx/__init__.py", line 257, in write
    self.write_document(entry)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/frontend/sphinx/__init__.py", line 267, in write_document
    rinoh_document.render(outfilename)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/document.py", line 443, in render
    self.part_page_counts = self._render_pages()
  File "/usr/local/lib/python3.10/dist-packages/rinoh/document.py", line 485, in _render_pages
    part_page_count += part.render(part_page_count.count + 1)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/template.py", line 449, in render
    page.render()
  File "/usr/local/lib/python3.10/dist-packages/rinoh/document.py", line 178, in render
    super().render(CONTENT, rerender=index > 0)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/layout.py", line 197, in render
    child.render(type, rerender)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/layout.py", line 197, in render
    child.render(type, rerender)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/layout.py", line 306, in render
    self._render(type, rerender)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/layout.py", line 366, in _render
    self.chain.render(self, rerender=rerender)
  File "/usr/local/lib/python3.10/dist-packages/rinoh/layout.py", line 637, in render
    self.flowables.flow(container, last_descender=None,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 840, in render
    return super().render(container, descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 534, in render
    self._flow_with_next(state, container, descender,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 571, in _flow_with_next
    flowable.flow(maybe_container, descender, state=flowable_state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 239, in flow
    self.flow_inner(margin_container, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 294, in flow_inner
    self.render(pad_cntnr, last_descender, state=state,
  File "/usr/local/lib/python3.10/dist-packages/rinoh/flowable.py", line 749, in render
    content_state_copy = copy(state.content_flowable_state)
AttributeError: 'GroupedFlowablesState' object has no attribute 'content_flowable_state'

@CLAassistant
Copy link

CLAassistant commented Dec 3, 2024

CLA assistant check
All committers have signed the CLA.

@brechtm
Copy link
Owner

brechtm commented Dec 6, 2024

Thanks! Can you point me to (or attach) the Sphinx project that triggers this bug?

@mythsmith
Copy link
Author

It's a 400 pages private repo on gitlab, I have no idea why this happens but I figured that class attribute must resolve in its own instance if asked. But... should not be asked as it already is a content flowable state itself so it would make no sense to ask.
I can give you access to the private repo.

@sc911
Copy link

sc911 commented Jul 28, 2025

Having this problem also. Also a large, multi page document (private repo also and sadly can't share it).
The error occurs not every time but is dependent on the page content and page breaks, so moving test around on the source pages fixes the issue temporarily.
Using the fix above this is fixed. Any chance this makes it to the next release?

@mythsmith
Copy link
Author

My fix is quite a bazooka to just let the program continue. I think there is an underlying problem which should be addressed instead: it makes no sense to ask what is the flowable state of a flowable state... I would at least raise a warning.

@brechtm
Copy link
Owner

brechtm commented Aug 23, 2025

@mythsmith Can you provide me access to the private repo? Or a minimal Sphinx project the reproduces the issue would be just as good. Thanks!

@mythsmith
Copy link
Author

@brechtm just saw your comment now, I never log in here: the repo would be on gitlab, do you have an account there?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants