#23406: Migrations not found when only .pyc files are available (e.g. in a 
frozen
environment)
-------------------------------------+-------------------------------------
     Reporter:  danielmenzel         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Migrations           |                  Version:  1.7
     Severity:  Normal               |               Resolution:
     Keywords:  migrations, .pyc,    |             Triage Stage:  Accepted
  frozen, cx_Freeze                  |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by andreydani):

 I agree a setting for the file extension would be better.

 I would like to use *.pyc on production (frozen) environments, but not
 when developing or testing.

 I have also made a small '''os.listdir''' replacement that searches for
 modules inside zip files.

 {{{
 def listdir(path):
     if not os.path.isdir(path):
         pos = path.lower().find('.zip')
         if pos >= 0:
             pos += 4
             zip = path[:pos]
             path_within = path[pos + 1:].replace('\\', '/')
             from zipfile import ZipFile
             zip = ZipFile(zip)
             return [a[len(path_within)+1:] for a in zip.namelist() if
 a.startswith(path_within)]
     return os.listdir(path)
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23406#comment:11>
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/070.3a4bcb9f852252132657051a8c8ce025%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to