#29091: Error on makemigrations:  '_NamespacePath' object does not support 
indexing
---------------------------------------+------------------------
               Reporter:  Rafael Lott  |          Owner:  nobody
                   Type:  Bug          |         Status:  new
              Component:  Migrations   |        Version:  2.0
               Severity:  Normal       |       Keywords:
           Triage Stage:  Unreviewed   |      Has patch:  0
    Needs documentation:  0            |    Needs tests:  0
Patch needs improvement:  0            |  Easy pickings:  0
                  UI/UX:  0            |
---------------------------------------+------------------------
 I upgraded from Django 1.11 to Django 2.0.

 When I ran 'makemigrations', I got this error.

 {{{
    File "/home/webapp/.virtualenvs/odin/lib/python3.5/site-
 packages/django/db/migrations/questioner.py", line 51, in ask_initial
     filenames = os.listdir(migrations_module.__path__[0])
 TypeError: '_NamespacePath' object does not support indexing
 }}}

 I manage to fix it by editing the file
 'django/db/migrations/questioner.py' line 51 from:
 {{{
 filenames = os.listdir(migrations_module.__path__[0])
 }}}

 to

 {{{
 filenames = os.listdir(list(migrations_module.__path__)[0])
 }}}

 I don't know if this is the correct solution.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29091>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.5cbd5c7d183f5f338f39263a2e2bf8ee%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to