I have gotten bitten by lingering bytecode in migrations on several 
occasions. Steps to reproduce are a little bit complex, but here is an 
rough example:

Local Box:
— have *.pyc rule in .gitignore
— create some migrations
— commit them

Server Box:
— pull repository
— execute migrations

Local Box:
— remove migrations
— commit
— create new initial migration

Server Box:
— pull repository
— remove migrations history from db
— run fake initial migration — get an error here

At this point, the server box has a migrations directory that looks 
something like this (bytecode is still around because it was in the 
gitignore):
— migrations 
    — __init__.py
    — 0001_initial.py
    — 0001_initial.pyc
    — 0002_second.pyc
    — 0003_third.pyc

When running "python manage migrate" the bytecode appears to be referenced, 
which often causes errors when running the migrations. When using git, for 
example "git clean -df" clears out the problem. What I am wondering is if 
it might make sense to make a deliberate attempt to ignore bytecode without 
accompanying *.py files. This appears to be an issue because of the way 
that migrations dynamically import python code, but I am not sure. Perhaps 
the problem is more subtle as I am not deeply familiar with the way that 
migrations work.

aryeh

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" 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].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1dbf1434-b24a-47c9-b45b-ae04530d7867%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to