Django 1.7 migration files do not support Python 3.2
Steps to reproduce:
- Run "python manage.py makemigrations appname" on a new app
- Run "python3.2 manage.py migrate" (with Django installed in python3.2 site-packages)
- View traceback due to syntax error. Example:
File "/.../django-email-log/email_log/migrations/0001_initial.py", line 14
(u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=True, primary_key=True)),
^
SyntaxError: invalid syntax
The syntax error is due to the use of the u prefix in front of string literals.
In my opinion, Python 3.2 support is unimportant because Python 3.3 made so many syntactic improvements. However, Python 3.2 support is currently noted in the documentation.
Change History
(7)
Severity: |
Normal → Release blocker
|
Triage Stage: |
Unreviewed → Accepted
|
Component: |
Database layer (models, ORM) → Migrations
|
Owner: |
changed from nobody to loic84
|
Status: |
new → assigned
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
I'm not too fond of it, but here is a tentative patch, note the generated migrations are hideous.
POC https://github.com/loic/django/tree/ticket22350.