Skip to content
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

display_side_effects management command could have better error on no docstring #32

Open
djm opened this issue Jan 12, 2023 · 2 comments

Comments

@djm
Copy link

djm commented Jan 12, 2023

When running python manage.py display_side_effects against a codebase with a side-effect that does not have a docstring defined - it errors hard with a very hard to grok error message.

File "/Users/[..snip...]/platform/.venv/lib/python3.10/site-packages/side_effects/management/commands/display_side_effects.py", line 28, in <dictcomp>
    label: sorted(handlers, key=handler_sort_key)
TypeError: '<' not supported between instances of 'NoneType' and 'list'
@zemgin
Copy link

zemgin commented Jan 12, 2023

Full [redacted] stack trace

Traceback (most recent call last):
  ...
  File "[..snip...]/side_effects/management/commands/display_side_effects.py", line 98, in handle
    events = sort_events(
  File "[..snip...]/side_effects/management/commands/display_side_effects.py", line 27, in sort_events
    return {
  File "[..snip...]/side_effects/management/commands/display_side_effects.py", line 28, in <dictcomp>
    label: sorted(handlers, key=handler_sort_key)
TypeError: '<' not supported between instances of 'NoneType' and 'list'
task: Failed to run task "freeze-snapshots": exit status 1

@hugorodgerbrown
Copy link
Member

This is a bug in the --sorted option. The command itself handles functions missing docstrings, but if you try and sort the output it blows up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants