-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
vague unpack parsing errors parsing google docstrings. #16
Comments
Is it the complete traceback? Did you run |
@pawamoy the
There has to be double space after annotation or mkdocstrings will have an error as described in original post. |
I don't think this is what is causing the issue. The traceback says "not enough values to unpack (expected 2, got 1)", so it probably means that an item in a dosctring section is not properly indented, or doesn't have a colon |
This will add a warning to the output with the path to the object's docstring causing the issue (pytkdocs code): for exception_line in block:
- annotation, description = exception_line.split(": ")
- exceptions.append(AnnotatedObject(annotation, description.lstrip(" ")))
+ try:
+ annotation, description = exception_line.split(": ")
+ except ValueError:
+ self.parsing_errors.append(f"{self.path}: Failed to get 'exception: description' pair from '{exception_line}'")
+ else:
+ exceptions.append(AnnotatedObject(annotation, description.lstrip(" "))) Expect a bugfix release of pytkdocs soon 🙂 Thanks for the report! |
Ah, and for things related to docstring parsing, could you open the issue on pytkdocs instead next time? Thanks 🙂 |
Thanks for the patch! Sorry for opening up the issue in the wrong project, wasn't aware the parsing is done in I found my issue. It was underindenting followup lines:
|
I'm using google docstrings format for my docstrings and I'm often getting:
It's really difficult to debug when the traceback only says which file is causing the error. Would be nice to include at least an aproximate where the fault actually is.
The text was updated successfully, but these errors were encountered: