#23045: Failed to load management commands after freezing by cx_freeze
-------------------------------------+-------------------------------------
     Reporter:                       |      Owner:  nobody
  keelung.yang.shandong@…            |     Status:  new
         Type:  Bug                  |    Version:  master
    Component:  Core (Management     |   Keywords:  management command
  commands)                          |  freeze cx_freeze
     Severity:  Normal               |  Has patch:  0
 Triage Stage:  Unreviewed           |      UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
 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
 {{{#!python
 return [f[:-3] for f in os.listdir(command_dir)
     if not f.startswith('_') and f.endswith('.py')]
 }}}

 to
 {{{#!python
 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

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23045>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.a2c6d92a534aef8d5742a05954396d1d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to