Opened 10 years ago
Closed 10 years ago
#23045 closed Bug (duplicate)
Failed to load management commands after freezing by cx_freeze
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | management command freeze cx_freeze |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Since it just searching .py but not .pyc files in function of find_commands() in django/core/management/__init__.py, but after freezing there is no .py files.
After changing this line from
return [f[:-3] for f in os.listdir(command_dir) if not f.startswith('_') and f.endswith('.py')]
to
return [f[:f.rindex('.')] for f in os.listdir(command_dir) if not f.startswith('_') and (f.endswith('.py') or f.endswith('.pyc'))]
it works.
Same code in branch of stable/1.7.x
Note:
See TracTickets
for help on using tickets.
Duplicate of #14952