-
Notifications
You must be signed in to change notification settings - Fork 189
ValueError: malformed node or string #368
Comments
I would say that something like this should be done: def safe_literal_eval(node) -> Optional[str]:
try:
return ast.literal_eval(node)
except ValueError:
return None # happens when literal eval cannot process node And then check that instead of |
Docstrings may not be f-strings. So actually the better fix is to specifically look for attempting to use a docstring as an f-string and issue a new error code. |
@lordmauve agreed, new rules are always a good idea 🙂 |
Any progress on this? It's quite puzzling to run into this, because there's no indication on what/where the error is, just a big fat python backtrace. |
Just came across this error, since we autogenerate some docstrings with f-strings using a decorator. pydocstyle <source_dir> --ignore-decorators=<name_of_decorator_gerating_docstring> |
I plan to pick it up and release a fix this weekend :) |
I have #381 updated. Waiting for a review so that we can merge it. |
Is this bug fixed? |
still present |
Hi! I am running
pydocstyle
as a part offlake8-docstrings
plugin which is a plugin forwemake-python-styleguide
.Original issue: wemake-services/wemake-python-styleguide#579
One of my users reported this bug:
This happens here: https://github.com/PyCQA/pydocstyle/blob/master/src/pydocstyle/checker.py#L159
Reproduction code:
The text was updated successfully, but these errors were encountered: