Opened 12 years ago

Closed 12 years ago

#19085 closed Bug (duplicate)

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

Reported by: Daniel Swarbrick Owned by: nobody
Component: Core (Management commands) Version: dev
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 Daniel Swarbrick 12 years ago.

Download all attachments as: .zip

Change History (2)

by Daniel Swarbrick, 12 years ago

Attachment: custom-commands.diff added

comment:1 by Claude Paroz, 12 years ago

Resolution: duplicate
Status: newclosed

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