1. Run "python manage.py makemigrations appname" on a new app
2. Run "python3.2 manage.py migrate" (with Django installed in python3.2
site-packages)
3. 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/22350>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* severity: Normal => Release blocker
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:1>
* component: Database layer (models, ORM) => Migrations
--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:2>
* status: new => assigned
* owner: nobody => loic84
--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:3>
* has_patch: 0 => 1
Comment:
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:4>
Comment (by charettes):
Created a [https://github.com/django/django/pull/2501 PR] based on Loïc's
initial patch relying on `from __future__ import unicode_literals`.
--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"72d3889db4eb3a14acb94f613edd79f0f27d26e3"]:
{{{
#!CommitTicketReference repository=""
revision="72d3889db4eb3a14acb94f613edd79f0f27d26e3"
Fixed #22350 -- Consistently serialize bytes and text in migrations.
Thanks to @treyhunner and Loïc for their suggestions and review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:6>
Comment (by Simon Charette <charette.s@…>):
In [changeset:"9fb61cb64a18924b7f252677166533f747884b48"]:
{{{
#!CommitTicketReference repository=""
revision="9fb61cb64a18924b7f252677166533f747884b48"
[1.7.x] Fixed #22350 -- Consistently serialize bytes and text in
migrations.
Thanks to @treyhunner and Loïc for their suggestions and review.
Backport of 72d3889db4 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:7>