Hi Guys,

I've had a traceback trying to autodoc a class in a module's __init__.py. It
was working before and I added some other :class:`...` directives above the
bit that's broken. There's probably some user error involved here, but an
UnboundLocalError sounds like something that should be fixed!

Here's the traceback:
Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/__init__.py",
line 131, in main
    app.builder.build_all()
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/builder.py",
line 174, in build_all
    self.build(None, summary='all source files', method='all')
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/builder.py",
line 217, in build
    for docname in self.status_iterator(iterator, 'reading... ', purple):
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/builder.py",
line 115, in status_iterator
    for item in iterable:
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/environment.py",
line 447, in update
    self.read_doc(docname, app=app)
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/environment.py",
line 485, in read_doc
    reader=SphinxStandaloneReader())
  File "/usr/lib/python2.5/site-packages/docutils/core.py", line 462, in
publish_doctree
    output = pub.publish(enable_exit_status=enable_exit_status)
  File "/usr/lib/python2.5/site-packages/docutils/core.py", line 204, in
publish
    self.settings)
  File "/usr/lib/python2.5/site-packages/docutils/readers/__init__.py", line
71, in read
    self.parse()
  File "/usr/lib/python2.5/site-packages/docutils/readers/__init__.py", line
77, in parse
    self.parser.parse(self.input, document)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/__init__.py",
line 155, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 171, in run
    input_source=document['source'])
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
234, in run
    context, state, transitions)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
422, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2844, in text
    self.section(title.lstrip(), source, style, lineno + 1, messages)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 309, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 377, in new_subsection
    node=section_node, match_titles=1)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 267, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
234, in run
    context, state, transitions)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
422, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2619, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 309, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 377, in new_subsection
    node=section_node, match_titles=1)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 267, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
234, in run
    context, state, transitions)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
422, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2200, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2212, in explicit_construct
    return method(self, expmatch)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 1974, in directive
    directive_function, match, type_name, option_presets)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2019, in run_directive
    self.state_machine)
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/ext/autodoc.py",
line 542, in autoclass_directive
    return _auto_directive(*args, **kwds)
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/ext/autodoc.py",
line 531, in _auto_directive
    state.nested_parse(result, 0, node)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 267, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
234, in run
    context, state, transitions)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
422, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2200, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2212, in explicit_construct
    return method(self, expmatch)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 1974, in directive
    directive_function, match, type_name, option_presets)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2019, in run_directive
    self.state_machine)
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/directives/desc.py",
line 485, in desc_directive
    state.nested_parse(content, content_offset, subnode)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 267, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
234, in run
    context, state, transitions)
  File "/usr/lib/python2.5/site-packages/docutils/statemachine.py", line
422, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2200, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2212, in explicit_construct
    return method(self, expmatch)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 1974, in directive
    directive_function, match, type_name, option_presets)
  File "/usr/lib/python2.5/site-packages/docutils/parsers/rst/states.py",
line 2019, in run_directive
    self.state_machine)
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/ext/autodoc.py",
line 536, in auto_directive
    return _auto_directive(*args, **kwds)
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/ext/autodoc.py",
line 507, in _auto_directive
    lineno, filename_set=filename_set)
  File
"/usr/lib/python2.5/site-packages/Sphinx-0.4.2-py2.5.egg/sphinx/ext/autodoc.py",
line 313, in generate_rst
    if not mod_cls:
UnboundLocalError: local variable 'mod_cls' referenced before assignment

I'd be happy to answer any questions and I'll also see if I can nail down
what's going wrong a bit better too!

Cheers,
Ben


-- 
Regards,
Ben Ford
[EMAIL PROTECTED]
+447792598685

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to