Opened 3 years ago

Closed 3 years ago

#19085 closed Bug (duplicate)

manage.py does not find custom commands if only .pyc file exists

Reported by: pressureman Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

django.core.management.find_commands() is written such that it only looks for .py files in the custom command directories. This fails if, for example, a project has been byte-compiled (eg. with compileall) and the original source .py files removed.

The attached patch will find .pyc and .pyo files as well (whilst still returning a list of unique commands).

Attachments (1)

custom-commands.diff (779 bytes) - added by pressureman 3 years ago.

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by pressureman

comment:1 Changed 3 years ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the report, but this has already been marked as won't fix in #14952. I don't think that our position on this matter changed.

Note: See TracTickets for help on using tickets.
Back to Top