Opened 14 years ago

Closed 12 years ago

#12206 closed New feature (duplicate)

manage.py fails if management commands directory contains only bytecode files

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

Description

If the django/core/management/commands directory has only bytecode files (.pyc or .pyo) instead of source files, running manage.py (or using the call_command function) will always fail with "unknown command".

This happens because the find_commands function in django/core/management/init.py only searches the commands directory for .py files.

Attachments (1)

12206.diff (679 bytes ) - added by wenjoseph 14 years ago.
Search for .py, .pyc and .pyo

Download all attachments as: .zip

Change History (7)

comment:1 by Russell Keith-Magee, 14 years ago

Triage Stage: UnreviewedAccepted

by wenjoseph, 14 years ago

Attachment: 12206.diff added

Search for .py, .pyc and .pyo

comment:2 by Matt McClanahan, 13 years ago

Severity: Normal
Type: New feature

comment:3 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:4 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:5 by Carl Meyer, 12 years ago

pyc files are an internal implementation detail of CPython and can't be relied on (in Python 3 they've already been moved into a __pycache__ subdirectory), so any patch that just changes Django to explicitly look for pyc files next to the py files is using an already-obsolete implementation detail.

The right approach here is to fix management command finding more generally so that it uses the proper Python APIs for finding and loading modules. There are patches on #14087 that do this, and should fix this too.

comment:6 by Claude Paroz, 12 years ago

Resolution: duplicate
Status: newclosed

Closing this one as a duplicate of #14087.

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