Menu

#311 Weird error description if parameter name != @param name

open
5
2009-06-21
2009-06-21
AndiDog
No

When you have a function with a single parameter "foo" and write an epydoc tag "@param bar: some documentation text", the "--debug" mode gives me a misleading Unicode error message:

File "C:\Program Files\Python\Scripts\epydoc.py", line 16, in <module>
cli()
File "C:\Program Files\Python\lib\site-packages\epydoc\cli.py", line 965, in cli
main(options, names)
File "C:\Program Files\Python\lib\site-packages\epydoc\cli.py", line 757, in main
exclude_parse=exclude_parse)
File "C:\Program Files\Python\lib\site-packages\epydoc\docbuilder.py", line 275, in build_doc_index
parse_docstring(val_doc, docindex, suppress_warnings)
File "C:\Program Files\Python\lib\site-packages\epydoc\docstringparser.py", line 285, in parse_docstring
report_errors(api_doc, docindex, parse_errors, field_warnings)
File "C:\Program Files\Python\lib\site-packages\epydoc\docstringparser.py", line 498, in report_errors
header += 'in %s' % name
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 21: ordinal not in range(128)

This doesn't really have anything to do with a UnicodeDecodeError, I simply had to replace the tag with the correct parameter name ("@param foo: some documentation text") and it worked. Maybe epydoc should have a check for this case, giving out a more helpful error message.

Cheers

Discussion


Log in to post a comment.