#71 parsing failure with -*- coding: utf-8 -*-

defect
open
Doug Hellmann
parser (18)
5
2003-11-16
2003-11-16
Matthias Klose
No

[forwarded from http://bugs.debian.org/219114 ]

Happydoc crashes when parsing a file that starts with a
coding
specification like:

# -*- coding: utf-8 -*-

The stack dump is then:

Traceback (most recent call last):
File "/usr/bin/happydoc", line 61, in ?
HappyDoc().run()
File
"/usr/lib/python2.3/site-packages/happydoclib/CommandLineApp.py",
line 315, in run
exit_code = apply(self.main,
tuple(self.remainingOpts))
File
"/usr/lib/python2.3/site-packages/happydoclib/appclass.py",
line 429, in main
parsed_modules = apply( self.docset_factory, (),
docset_init_params)
File
"/usr/lib/python2.3/site-packages/happydoclib/happydocset.py",
line 268, in __init__
self.processFiles(inputModuleNames)
File
"/usr/lib/python2.3/site-packages/happydoclib/happydocset.py",
line 742, in processFiles
file_info = self.getFileInfo(file_name)
File
"/usr/lib/python2.3/site-packages/happydoclib/happydocset.py",
line 620, in getFileInfo
self._default_parser_config_values,
File
"/usr/lib/python2.3/site-packages/happydoclib/parseinfo/__init__.py",
line 186, in getDocs
defaultConfigValues=defaultConfigValues)
File
"/usr/lib/python2.3/site-packages/happydoclib/parseinfo/moduleinfo.py",
line 117, in __init__
defaultConfigValues=defaultConfigValues)
File
"/usr/lib/python2.3/site-packages/happydoclib/parseinfo/suite.py",
line 118, in __init__
self._extractInfo(tree)
File
"/usr/lib/python2.3/site-packages/happydoclib/parseinfo/suite.py",
line 152, in _extractInfo
found, vars = match(DOCSTRING_STMT_PATTERN, tree[3])
IndexError: tuple index out of range

Discussion

  • Nils Decker
    Nils Decker
    2004-07-14

    Logged In: YES
    user_id=222501

    I had the same problem. Having the encoding-Line as the
    second line with the first one blank worked for me.