﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23226	Migrations generated by python2 break when using python3 to migrate	morshed.nader@…	Andrew Godwin	"It seems that the use of byte strings in the files generated by `python2 manage.py makemigrations <module>` cause migrations to break when running `python3 manage.py migrate`. This seems to be caused by the use of byte strings in the model field names, as replacing all instances of `b''` with `''` fixes the issue.

I have created a simple demo project that will cause an error to be throw during migrations. This includes migrations already generated by Python2 + Django-1.7rc2 + makemigrations:

https://github.com/naderm/django-migrations-test

Which throws the exception:

{{{
$ python3 manage.py migrate

...

django.db.models.fields.FieldDoesNotExist: ModelTest has no field named b'season'

$ python2 manage.py migrate
Operations to perform:
  Apply all migrations: admin, contenttypes, migratemodule, auth, sessions
Running migrations:
  Applying migratemodule.0001_initial... OK
  Applying sessions.0001_initial... OK
}}}

The case here uses a unique_together constraint that causes the exception to be thrown, but I have also seen the same error generated by the use of foreign keys and many to many relations."	Bug	closed	Migrations	1.7-rc-2	Release blocker	fixed		Simon Charette cmawebsite@…	Accepted	0	0	0	0	0	0
