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

Prevent AssertionError #67

Closed
wants to merge 1 commit into from
Closed

Prevent AssertionError #67

wants to merge 1 commit into from

Conversation

calve
Copy link

@calve calve commented Aug 24, 2016

For ununderstood reasons, my sphinx tree fails to build with the following stacktrace. This patch prevent this. I do not really understand what happened here so any comment is welcomed : )

Please let me know if I can add information.

Not yet converged, rendering again...
100% [========================================] ETA 00:00 (00:53)

Exception occurred:
  File "/home/goudale/.virtualenvs/diplodocus3/lib/python3.5/site-packages/rinoh/document.py", line 458, in create_outlines
    assert section.level == current_level + 1
AssertionError
The full traceback has been saved in /tmp/sphinx-err-tyt5znkg.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [Makefile:149: rinoh] Error 1

For ununderstood reasons, my sphinx tree fails to build with the following stacktrace. This patch prevent this. I do not really understand what happened here so any comment is welcomed : )

Please let me know if I can add information.

```Not yet converged, rendering again...
100% [========================================] ETA 00:00 (00:53)

Exception occurred:
  File "/home/goudale/.virtualenvs/diplodocus3/lib/python3.5/site-packages/rinoh/document.py", line 458, in create_outlines
    assert section.level == current_level + 1
AssertionError
The full traceback has been saved in /tmp/sphinx-err-tyt5znkg.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [Makefile:149: rinoh] Error 1
```
@CLAassistant
Copy link

CLAassistant commented Aug 24, 2016

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

Coverage Status

Coverage decreased (-39.3%) to 46.037% when pulling 05f0932 on calve:patch-1 into 3478f0b on brechtm:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-39.3%) to 46.037% when pulling 05f0932 on calve:patch-1 into 3478f0b on brechtm:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-39.3%) to 46.037% when pulling 05f0932 on calve:patch-1 into 3478f0b on brechtm:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-39.3%) to 46.037% when pulling 05f0932 on calve:patch-1 into 3478f0b on brechtm:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-39.3%) to 46.037% when pulling 05f0932 on calve:patch-1 into 3478f0b on brechtm:master.

@brechtm brechtm added the bug label Aug 31, 2016
@brechtm brechtm added this to the 0.2.2 milestone Aug 31, 2016
@brechtm
Copy link
Owner

brechtm commented Sep 1, 2016

Thanks for the bug report and suggested fix!

The create_outlines function is responsible for creating the hierarchy of bookmarks in the PDF that link to each section. The assert statement you removed is in fact a sanity check; it assures that no levels are skipped. A section should not be directly followed by a sub-sub-section, for example.

Could you supply me with the Sphinx project that causes the crash? Or better yet, a minimal example that triggers the problem? I'd like to find the root cause of the problem.

BTW Please note that you need to accept the CLA before I can accept pull requests.

@calve
Copy link
Author

calve commented Sep 1, 2016

Thanks for the update.

A section should not be directly followed by a sub-sub-section, for example.

Indeed, I have documents with multiple autogenerated-cross-inclusions which probably fall under this case. IMHO a warning should be raised but should not make the build fails.

I'll try to send you a minimal example in the next few days.

@brechtm
Copy link
Owner

brechtm commented Sep 6, 2016

@calve Have you had any time to construct a minimal example yet? If possible, I'd like to include a fix in the next release. If you can provide me with the full Sphinx project sources, that is fine too.

@calve
Copy link
Author

calve commented Sep 16, 2016

@brechtm I just want to let you know that I aknowledge your request. I'm having some troubles to set up a minimal example reproducing the bug.
Also, sometimes that the bug does not occurs, depending how sphinx is invoqued, and more specifically it appear to depend of the internal sphinx _build/doctrees folder state . I need more investigation, and will keep you updated.

@brechtm
Copy link
Owner

brechtm commented Sep 16, 2016

Thanks for the update!

I understand this is not a trivial problem (and may reveal a Sphinx bug). I'll take your suggestion and issue a warning instead of crashing for the next release. The root cause can be solved at a later point.

brechtm added a commit that referenced this pull request Oct 2, 2016
@brechtm brechtm removed this from the 0.3.0 milestone Nov 28, 2016
@brechtm brechtm closed this Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants