#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: master
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 Changed 14 months ago by claudep

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

Duplicate of #14952

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