#22577: The makemigrations management command has a problem with migrations dir
----------------------------+----------------------------------------------
     Reporter:              |      Owner:  nobody
  japrogramer@…             |     Status:  new
         Type:  Bug         |    Version:  master
    Component:  Migrations  |   Keywords:  makemigrations, fail, init, file
     Severity:  Normal      |  Has patch:  0
 Triage Stage:  Unreviewed  |      UI/UX:  0
Easy pickings:  0           |
----------------------------+----------------------------------------------
 When the migration folder does not have an init
 http://codepad.com/U2nGptor
 {{{

 File "/home/archie/git/django/django/db/migrations/writer.py", line 150,
 in path basedir = os.path.dirname(migrations_module.__file__)
 AttributeError: 'module' object has no attribute '__file__'

 }}}

 the problem lies with makemigrations.py line 134-36 they are checking to
 see if an init file exists in the migrations dir but it checks using  a
 line that depends on the existence of __init__.py. line 130 , writer.path,
 following to see where this code comees from led me to line149 and 150
 which need there to be an init file for __file__ to be an attribute there
 ..
 tl;dr
 makemigrations checks for an init file using os.path.isdir but with a call
 that depends on an __init__.py for it treats it as a module before it
 knows if it is a module

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22577>
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/064.758b994a72f5967381a4dc1dc04df9ec%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to