Opened 10 years ago

Closed 10 years ago

#23045 closed Bug (duplicate)

Failed to load management commands after freezing by cx_freeze

Reported by: keelung.yang.shandong@… 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

Change History (1)

comment:1 by Claude Paroz, 10 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #14952

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