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

CPObject.attach_name not properly handling NotImplementedError #560

Closed
shimizukawa opened this issue Jan 2, 2015 · 2 comments
Closed

CPObject.attach_name not properly handling NotImplementedError #560

shimizukawa opened this issue Jan 2, 2015 · 2 comments
Labels

Comments

@shimizukawa
Copy link
Member

Hi,

I ran into a NotImplementedError while trying to use cpp:type:: that seems to be CPPObject.attach_name's (in sphinx/domains/cpp.py) fault -- it doesn't correctly handle the exception, which according to the docstring for cpp.py's DefExpr.split_owner() (cpp.py, line 148), is what gets raised when the name doesn't support the operation. The following patch made things run again:

mbolivar@sleepy domains$ diff cpp.py~ cpp.py
797c797,800
<         owner, name = name.split_owner()

---
>         try:
>             owner, name = name.split_owner()
>         except NotImplementedError:
>             owner = None

Full traceback follows:

mbolivar@sleepy ~$ cat /var/folders/wk/wk6dwngzEtinh62BXvSfWU+++TI/-Tmp-/sphinx-err-_C4L2l.log 
# Sphinx version: 1.0.4
# Docutils version: 0.7 release
# Jinja2 version: 2.5.2
Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/cmdline.py", line 173, in main
    app.build(force_all, filenames)
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/application.py", line 207, in build
    self.builder.build_update()
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/builders/__init__.py", line 198, in build_update
    'out of date' &#37; len(to_build))
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/builders/__init__.py", line 218, in build
    purple, length):
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/builders/__init__.py", line 120, in status_iterator
    for item in iterable:
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/environment.py", line 515, in update_generator
    self.read_doc(docname, app=app)
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/environment.py", line 655, in read_doc
    pub.publish()
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/core.py", line 203, in publish
    self.settings)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/readers/__init__.py", line 69, in read
    self.parse()
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/readers/__init__.py", line 75, in parse
    self.parser.parse(self.input, document)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/__init__.py", line 157, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 170, in run
    input_source=document['source'])
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/statemachine.py", line 233, in run
    context, state, transitions)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/statemachine.py", line 454, in check_line
    return method(match, context, next_state)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 2706, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 329, in section
    self.new_subsection(title, lineno, messages)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
    node=section_node, match_titles=1)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
    node=node, match_titles=match_titles)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/statemachine.py", line 233, in run
    context, state, transitions)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/statemachine.py", line 454, in check_line
    return method(match, context, next_state)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 2706, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 329, in section
    self.new_subsection(title, lineno, messages)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
    node=section_node, match_titles=1)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
    node=node, match_titles=match_titles)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/statemachine.py", line 233, in run
    context, state, transitions)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/statemachine.py", line 454, in check_line
    return method(match, context, next_state)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 2283, in explicit_markup
    self.explicit_list(blank_finish)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 2314, in explicit_list
    match_titles=self.state_machine.match_titles)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 321, in nested_list_parse
    node=node, match_titles=match_titles)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/statemachine.py", line 233, in run
    context, state, transitions)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/statemachine.py", line 454, in check_line
    return method(match, context, next_state)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 2587, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 2293, in explicit_construct
    return method(self, expmatch)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 2035, in directive
    directive_class, match, type_name, option_presets)
  File "/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg/docutils/parsers/rst/states.py", line 2086, in run_directive
    result = directive_instance.run()
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/domains/__init__.py", line 191, in run
    return BaseDirective.run(self)
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/directives/__init__.py", line 146, in run
    name = self.handle_signature(sig, signode)
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/domains/cpp.py", line 866, in handle_signature
    self.describe_signature(signode, rv)
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/domains/cpp.py", line 905, in describe_signature
    self.attach_name(signode, obj.name)
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/domains/cpp.py", line 797, in attach_name
    owner, name = name.split_owner()
  File "/Library/Python/2.6/site-packages/Sphinx-1.0.4-py2.6.egg/sphinx/domains/cpp.py", line 154, in split_owner
    raise NotImplementedError()

Best,

Marti Bolivar

mbolivar@leaflabs.com


@shimizukawa
Copy link
Member Author

From Georg Brandl on 2011-01-04 11:55:42+00:00

Okay, should be fixed in <<cset 4175711>>.

@shimizukawa
Copy link
Member Author

From Georg Brandl on 2014-10-18 07:30:26+00:00

Removing version: 1.0.4 (automated comment)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant