autosummary abborts: NameError: global name 'm' is not defined

timmie avatartimmie created an issue

I get this error:

eading sources... [ 89%] modules_autosummary                                                                                
Exception occurred:
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/util/__init__.py", line 446, in split_explicit_title
    return True, m.group(1), m.group(2)
NameError: global name 'm' is not defined

the sphinx log says:

# Sphinx version: 1.0
# Docutils version: 0.5 release
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/cmdline.py", line 172, in main
    app.build(all_files, filenames)
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/application.py", line 130, in build
    self.builder.build_update()
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/builders/__init__.py", line 265, in build_update
    'out of date' % len(to_build))
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/builders/__init__.py", line 285, in build
    purple, length):
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/builders/__init__.py", line 131, in status_iterator
    for item in iterable:
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/environment.py", line 518, in update_generator
    self.read_doc(docname, app=app)
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/environment.py", line 609, in read_doc
    pub.publish()
  File "/usr/lib/python2.6/dist-packages/docutils/core.py", line 204, in publish
    self.settings)
  File "/usr/lib/python2.6/dist-packages/docutils/readers/__init__.py", line 69, in read
    self.parse()
  File "/usr/lib/python2.6/dist-packages/docutils/readers/__init__.py", line 75, in parse
    self.parser.parse(self.input, document)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/__init__.py", line 157, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 170, in run
    input_source=document['source'])
  File "/usr/lib/python2.6/dist-packages/docutils/statemachine.py", line 232, in run
    context, state, transitions)
  File "/usr/lib/python2.6/dist-packages/docutils/statemachine.py", line 420, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 2658, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 308, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 376, in new_subsection
    node=section_node, match_titles=1)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 266, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python2.6/dist-packages/docutils/statemachine.py", line 232, in run
    context, state, transitions)
  File "/usr/lib/python2.6/dist-packages/docutils/statemachine.py", line 420, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 2241, in explicit_markup
    self.explicit_list(blank_finish)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 2269, in explicit_list
    match_titles=self.state_machine.match_titles)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 300, in nested_list_parse
    node=node, match_titles=match_titles)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python2.6/dist-packages/docutils/statemachine.py", line 232, in run
    context, state, transitions)
  File "/usr/lib/python2.6/dist-packages/docutils/statemachine.py", line 420, in check_line
    return method(match, context, next_state)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 2542, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 2251, in explicit_construct
    return method(self, expmatch)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 1994, in directive
    directive_class, match, type_name, option_presets)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 2043, in run_directive
    result = directive_instance.run()
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/ext/autosummary/__init__.py", line 193, in run
    nodes = self.get_table(items)
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/ext/autosummary/__init__.py", line 332, in get_table
    append_row(col1, col2)
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/ext/autosummary/__init__.py", line 316, in append_row
    self.state.nested_parse(vl, 0, node)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 266, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib/python2.6/dist-packages/docutils/statemachine.py", line 238, in run
    result = state.eof(context)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 2606, in eof
    self.blank(None, context, None)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 2598, in blank
    context, self.state_machine.abs_line_number() - 1)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 399, in paragraph
    textnodes, messages = self.inline_text(text, lineno)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 408, in inline_text
    return self.inliner.parse(text, lineno, self.memo, self.parent)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 492, in parse
    lineno)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 746, in interpreted_or_phrase_ref
    lineno)
  File "/usr/lib/python2.6/dist-packages/docutils/parsers/rst/states.py", line 802, in interpreted
    nodes, messages2 = role_fn(role, rawsource, text, lineno, self)
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/roles.py", line 137, in xfileref_role
    has_explicit_title, title, target = split_explicit_title(text)
  File "/usr/local/lib/python2.6/dist-packages/Sphinx-1.0dev_20090903-py2.6.egg/sphinx/util/__init__.py", line 446, in split_explicit_title
    return True, m.group(1), m.group(2)
NameError: global name 'm' is not defined

What could be the cause?

Comments (2)

  1. timmie

    This happens with

    .. autosummary::
       :toctree: ./generated
       
       gluon.utils
    

    on the code:

    #!/usr/bin/env python
    # coding: utf-8
    
    """
    This file is part of web2py Web Framework (Copyrighted, 2007-2009).
    Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu>.
    License: GPL v2
    """
    
    import hashlib
    
    
    def md5_hash(text):
        """ Generate a md5 hash with the given text """
    
        return hashlib.md5(text).hexdigest()
    
    
    def hash(text, digest_alg = 'md5'):
        """
        Generates hash with the given text using the specified
        digest hashing algorithm
        """
        if not isinstance(digest_alg,str):
            h = digest_alg(text)
        else:
            h = hashlib.new(digest_alg)
            h.update(text)
        return h.hexdigest()
    
    def get_digest(value):
        """
        Returns a hashlib digest algorithm from a string
        """ 
        if not isinstance(value,str):
            return value
        elif value == "md5":
            return hashlib.md5
        elif value == "sha1":
            return hashlib.sha1
        elif value == "sha224":
            return hashlib.sha224
        elif value == "sha256":
            return hashlib.sha256
        elif value == "sha384":
            return hashlib.sha384
        elif value == "sha512":
            return hashlib.sha512
        else:
            raise ValueError("Invalid digest algorithm")
    
  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.