{"action":"closed","issue":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/5644","repository_url":"https://api.github.com/repos/sphinx-doc/sphinx","labels_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/5644/labels{/name}","comments_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/5644/comments","events_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/5644/events","html_url":"https://github.com/sphinx-doc/sphinx/issues/5644","id":381664076,"node_id":"MDU6SXNzdWUzODE2NjQwNzY=","number":5644,"title":"AttributeError: 'NoneType' object has no attribute 'content_'","user":{"login":"stephaniebamerico","id":16976543,"node_id":"MDQ6VXNlcjE2OTc2NTQz","avatar_url":"https://avatars1.githubusercontent.com/u/16976543?v=4","gravatar_id":"","url":"https://api.github.com/users/stephaniebamerico","html_url":"https://github.com/stephaniebamerico","followers_url":"https://api.github.com/users/stephaniebamerico/followers","following_url":"https://api.github.com/users/stephaniebamerico/following{/other_user}","gists_url":"https://api.github.com/users/stephaniebamerico/gists{/gist_id}","starred_url":"https://api.github.com/users/stephaniebamerico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephaniebamerico/subscriptions","organizations_url":"https://api.github.com/users/stephaniebamerico/orgs","repos_url":"https://api.github.com/users/stephaniebamerico/repos","events_url":"https://api.github.com/users/stephaniebamerico/events{/privacy}","received_events_url":"https://api.github.com/users/stephaniebamerico/received_events","type":"User","site_admin":false},"labels":[{"id":162407998,"node_id":"MDU6TGFiZWwxNjI0MDc5OTg=","url":"https://api.github.com/repos/sphinx-doc/sphinx/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-16T16:12:11Z","updated_at":"2018-12-20T01:13:17Z","closed_at":"2018-12-20T01:13:17Z","author_association":"NONE","body":"### Problem\r\nI get the error `AttributeError: 'NoneType' object has no attribute 'content_'` when I try to build documentation using Sphinx + Breathe + Doxygen. I believe it is related to issue #3709 and #3761, but the suggestion to fix does not work. Breathe 4.11 already implements the code suggested by @tk0miya (https://github.com/sphinx-doc/sphinx/issues/3709#issuecomment-299645822).\r\n\r\n#### Procedure to reproduce the problem\r\nUnfortunately I can not share the code of my project, but I was able to reproduce the error in [another project](https://github.com/QuantStack/xtensor) that also uses Sphinx + Breathe + Doxygen. \r\n\r\n1. Add a '_doxyfile.rst_' file in '_xtensor/docs/source/_' with the content:\r\n```\r\nDoxygen Files\r\n=============\r\n.. doxygenindex::\r\n   :project: xtensor\r\n```\r\n2. Add '_doxyfile_' to the '_index.rst_' file. You may also need to add the `breathe_default_project = \"xtensor\"` line to the `conf.py` file.\r\n\r\n3. Then you execute `make html` on '_xtensor/docs/_' and the error appears.\r\n\r\nThe error does not occur when I use `.. doxygenclass :: <Project class>`, only with `.. doxygenindex ::`. I understand it might be a Breathe bug, but I do not know.\r\n\r\n#### Error logs / results\r\n- Result of the `make html` command:\r\n```\r\nException occurred:\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 174, in to_string\r\n    for p in node.content_:\r\nAttributeError: 'NoneType' object has no attribute 'content_'\r\n```\r\n\r\n- Sphinx Log:\r\n```\r\n# Sphinx version: 1.8.2\r\n# Python version: 2.7.12 (CPython)\r\n# Docutils version: 0.14 \r\n# Jinja2 version: 2.10\r\n# Last messages:\r\n#   Running Sphinx v1.8.2\r\n#   making output directory...\r\n#   building [mo]: targets for 0 po files that are out of date\r\n#   building [html]: targets for 2 source files that are out of date\r\n#   updating environment:\r\n#   2 added, 0 changed, 0 removed\r\n#   reading sources... [ 50%] doxydoc\r\n# Loaded extensions:\r\n#   sphinx.ext.mathjax (1.8.2) from /home/stbr6072/.local/lib/python2.7/site-packages/sphinx/ext/mathjax.pyc\r\n#   alabaster (0.7.12) from /home/stbr6072/.local/lib/python2.7/site-packages/alabaster/__init__.pyc\r\n#   breathe (4.11.0) from /usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/__init__.pyc\r\nTraceback (most recent call last):\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/cmd/build.py\", line 304, in build_main\r\n    app.build(args.force_all, filenames)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/application.py\", line 341, in build\r\n    self.builder.build_update()\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py\", line 347, in build_update\r\n    len(to_build))\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py\", line 360, in build\r\n    updated_docnames = set(self.read())\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py\", line 468, in read\r\n    self._read_serial(docnames)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py\", line 490, in _read_serial\r\n    self.read_doc(docname)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/builders/__init__.py\", line 534, in read_doc\r\n    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/io.py\", line 318, in read_doc\r\n    pub.publish()\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/core.py\", line 217, in publish\r\n    self.settings)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/readers/__init__.py\", line 72, in read\r\n    self.parse()\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/readers/__init__.py\", line 78, in parse\r\n    self.parser.parse(self.input, document)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/sphinx/parsers.py\", line 88, in parse\r\n    self.statemachine.run(inputstring, document, inliner=self.inliner)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 171, in run\r\n    input_source=document['source'])\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py\", line 239, in run\r\n    context, state, transitions)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py\", line 460, in check_line\r\n    return method(match, context, next_state)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 2753, in underline\r\n    self.section(title, source, style, lineno - 1, messages)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 327, in section\r\n    self.new_subsection(title, lineno, messages)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 395, in new_subsection\r\n    node=section_node, match_titles=True)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 282, in nested_parse\r\n    node=node, match_titles=match_titles)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 196, in run\r\n    results = StateMachineWS.run(self, input_lines, input_offset)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py\", line 239, in run\r\n    context, state, transitions)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py\", line 460, in check_line\r\n    return method(match, context, next_state)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 2328, in explicit_markup\r\n    self.explicit_list(blank_finish)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 2358, in explicit_list\r\n    match_titles=self.state_machine.match_titles)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 319, in nested_list_parse\r\n    node=node, match_titles=match_titles)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 196, in run\r\n    results = StateMachineWS.run(self, input_lines, input_offset)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py\", line 239, in run\r\n    context, state, transitions)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/statemachine.py\", line 460, in check_line\r\n    return method(match, context, next_state)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 2631, in explicit_markup\r\n    nodelist, blank_finish = self.explicit_construct(match)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 2338, in explicit_construct\r\n    return method(self, expmatch)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 2081, in directive\r\n    directive_class, match, type_name, option_presets)\r\n  File \"/home/stbr6072/.local/lib/python2.7/site-packages/docutils/parsers/rst/states.py\", line 2130, in run_directive\r\n    result = directive_instance.run()\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/directive/index.py\", line 90, in run\r\n    return self.handle_contents(project_info)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/directive/index.py\", line 59, in handle_contents\r\n    node_list = object_renderer.render(context.node_stack[0], context)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1305, in render\r\n    result = method(self, node)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 455, in visit_doxygen\r\n    nodelist.extend(self.render(compound))\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1305, in render\r\n    result = method(self, node)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1235, in dispatch_compound\r\n    return self.visit_file(node)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 540, in visit_file\r\n    return self.visit_compound(node, render_signature=render_signature)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 469, in visit_compound\r\n    rendered_data = self.render(file_data, parent_context)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1305, in render\r\n    result = method(self, node)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 460, in visit_doxygendef\r\n    return self.render(node.compounddef)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1305, in render\r\n    result = method(self, node)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 611, in visit_compounddef\r\n    child_nodes = self.render(sectiondef)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1305, in render\r\n    result = method(self, node)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 645, in visit_sectiondef\r\n    node_list.extend(self.render_iterable(node.memberdef))\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1315, in render_iterable\r\n    output.extend(self.render(entry))\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1305, in render\r\n    result = method(self, node)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 1242, in dispatch_memberdef\r\n    return self.visit_function(node)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 985, in visit_function\r\n    param_decl = get_param_decl(param)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 181, in get_param_decl\r\n    param_type = to_string(param.type_)\r\n  File \"/usr/local/lib/python2.7/dist-packages/breathe-4.11.0-py2.7.egg/breathe/renderer/sphinxrenderer.py\", line 174, in to_string\r\n    for p in node.content_:\r\nAttributeError: 'NoneType' object has no attribute 'content_'\r\n```\r\n\r\n\r\n#### Expected results\r\nGenerate the documentation.\r\n\r\n### Environment info\r\n- OS: Linux Ubuntu 16.04\r\n- Python version: 2.7.12\r\n- Sphinx version: 1.8.2\r\n- Breathe version: 4.11\r\n"}}
{"actor":{"display_login":"tk0miya"}}