[Django] #22350: Django 1.7 migration files do not support Python 3.2

25 views
Skip to first unread message

Django

unread,
Mar 27, 2014, 9:01:18 PM3/27/14
to django-...@googlegroups.com
#22350: Django 1.7 migration files do not support Python 3.2
----------------------------------------------+------------------------
Reporter: treyhunner | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.7-beta-1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+------------------------
Steps to reproduce:

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.

Django

unread,
Mar 28, 2014, 2:41:58 AM3/28/14
to django-...@googlegroups.com
#22350: Django 1.7 migration files do not support Python 3.2
-------------------------------------+-------------------------------------

Reporter: treyhunner | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version:
(models, ORM) | 1.7-beta-1
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 aaugustin):

* 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>

Django

unread,
Mar 29, 2014, 1:27:12 AM3/29/14
to django-...@googlegroups.com
#22350: Django 1.7 migration files do not support Python 3.2
---------------------------------+--------------------------------------

Reporter: treyhunner | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7-beta-1

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 akaariai):

* component: Database layer (models, ORM) => Migrations


--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:2>

Django

unread,
Mar 29, 2014, 1:53:47 AM3/29/14
to django-...@googlegroups.com
#22350: Django 1.7 migration files do not support Python 3.2
---------------------------------+--------------------------------------
Reporter: treyhunner | Owner: loic84
Type: Bug | Status: assigned

Component: Migrations | Version: 1.7-beta-1
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 loic84):

* status: new => assigned
* owner: nobody => loic84


--
Ticket URL: <https://code.djangoproject.com/ticket/22350#comment:3>

Django

unread,
Mar 29, 2014, 3:39:04 AM3/29/14
to django-...@googlegroups.com
#22350: Django 1.7 migration files do not support Python 3.2
---------------------------------+--------------------------------------
Reporter: treyhunner | Owner: loic84
Type: Bug | Status: assigned
Component: Migrations | Version: 1.7-beta-1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by loic84):

* 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>

Django

unread,
Mar 31, 2014, 3:32:40 PM3/31/14
to django-...@googlegroups.com
#22350: Django 1.7 migration files do not support Python 3.2
---------------------------------+--------------------------------------
Reporter: treyhunner | Owner: loic84
Type: Bug | Status: assigned
Component: Migrations | Version: 1.7-beta-1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

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>

Django

unread,
Apr 13, 2014, 6:24:57 PM4/13/14
to django-...@googlegroups.com
#22350: Django 1.7 migration files do not support Python 3.2
---------------------------------+--------------------------------------
Reporter: treyhunner | Owner: loic84
Type: Bug | Status: closed
Component: Migrations | Version: 1.7-beta-1
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by Simon Charette <charette.s@…>):

* 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>

Django

unread,
Apr 13, 2014, 7:04:15 PM4/13/14
to django-...@googlegroups.com
#22350: Django 1.7 migration files do not support Python 3.2
---------------------------------+--------------------------------------
Reporter: treyhunner | Owner: loic84
Type: Bug | Status: closed
Component: Migrations | Version: 1.7-beta-1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages