#23226: Migrations generated by python2 break when using python3 to migrate ---------------------------------+------------------------------------ Reporter: morshed.nader@… | Owner: nobody Type: Bug | Status: new Component: Migrations | Version: 1.7-rc-2 Severity: Release blocker | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ---------------------------------+------------------------------------ Changes (by charettes):
* stage: Unreviewed => Accepted Comment: I'm getting the following traceback on Python 3.3.1 with 1.7r2 and master. {{{ Operations to perform: Apply all migrations: migratemodule, admin, auth, contenttypes, sessions Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying migratemodule.0001_initial...Traceback (most recent call last): File "/home/simon/workspace/django/django/db/models/options.py", line 414, in get_field_by_name return self._name_map[name] AttributeError: 'Options' object has no attribute '_name_map' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/simon/workspace/django/django/db/models/options.py", line 417, in get_field_by_name return cache[name] KeyError: b'season' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./manage.py", line 11, in <module> execute_from_command_line(sys.argv) File "/home/simon/workspace/django/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() File "/home/simon/workspace/django/django/core/management/__init__.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/simon/workspace/django/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **options.__dict__) File "/home/simon/workspace/django/django/core/management/base.py", line 337, in execute output = self.handle(*args, **options) File "/home/simon/workspace/django/django/core/management/commands/migrate.py", line 160, in handle executor.migrate(targets, plan, fake=options.get("fake", False)) File "/home/simon/workspace/django/django/db/migrations/executor.py", line 63, in migrate self.apply_migration(migration, fake=fake) File "/home/simon/workspace/django/django/db/migrations/executor.py", line 97, in apply_migration migration.apply(project_state, schema_editor) File "/home/simon/workspace/django/django/db/migrations/migration.py", line 107, in apply operation.database_forwards(self.app_label, schema_editor, project_state, new_state) File "/home/simon/workspace/django/django/db/migrations/operations/models.py", line 241, in database_forwards getattr(new_model._meta, self.option_name, set()), File "/home/simon/workspace/django/django/db/backends/sqlite3/schema.py", line 188, in alter_unique_together self._remake_table(model, override_uniques=new_unique_together) File "/home/simon/workspace/django/django/db/backends/sqlite3/schema.py", line 121, in _remake_table self.create_model(temp_model) File "/home/simon/workspace/django/django/db/backends/schema.py", line 261, in create_model columns = [model._meta.get_field_by_name(field)[0].column for field in fields] File "/home/simon/workspace/django/django/db/backends/schema.py", line 261, in <listcomp> columns = [model._meta.get_field_by_name(field)[0].column for field in fields] File "/home/simon/workspace/django/django/db/models/options.py", line 420, in get_field_by_name % (self.object_name, name)) django.db.models.fields.FieldDoesNotExist: ModelTest has no field named b'season' }}} Thanks to PEP3134 it looks like it might be related to something else. -- Ticket URL: <https://code.djangoproject.com/ticket/23226#comment:2> 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/081.e3e82e46f888452ece5685760473a433%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.