Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#19038 closed Uncategorized (fixed)

Add Experimental Support for Python 3.3

Reported by: Ian Clelland Owned by: nobody
Component: Python 3 Version: dev
Severity: Release blocker Keywords:
Cc: ojiidotch@…, aenor.realm@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The installation documentation currently claims that Django has "experimental" support for Python 3.2 and 3.3. Python 3.2 support is pretty solid, but there are several test cases that fail on 3.3 (Even with the hash randomization patch from #17758)

The major differences that are causing test failures in 3.3 are:

  1. threading._Event has been renamed to threading.Event (This stops the test runner from even staring)
  2. The technical error view attempts to apply source character encoding twice when using a PEP 302 loader
  3. Several Python exceptions have had their messages reworded, and we are (recklessly) depending on the exact error message text in tests

There are some import errors that I haven't tracked down as well

Change History (19)

comment:1 by Ian Clelland, 11 years ago

I'm tracking this on my github fork at https://github.com/clelland/django/tree/ticket_19038

It's based on my fix for 17758, but if it helps get this in, I can rebase it off of master (and we can all turn off hash randomization to run Python 3.3)

comment:2 by Aymeric Augustin, 11 years ago

Severity: NormalRelease blocker

Either we can support 3.3 in the 1.5 release, or we should remove the claim for Python 3.3 support.

comment:3 by Anssi Kääriäinen, 11 years ago

I know of one in the ORM where dict-ordering will be a problem:

qs.filter(m2m__somefield=F('m2m__somefield'), m2m__otherfield='foo')

The query generated is different depending on the order the clauses are applied, and that again is dict ordering dependant. This is tracked in #18375, see in particular comment 3 for details.

IMO this needs some solution for Python 3.3... Unfortunately solving this will result in backwards incompatible change no matter what is done.

comment:4 by Ian Clelland, 11 years ago

Is #18375, then, a hash randomization issue or a Python 3.3 issue? I think that the two issues are separable, at least in principle.

(It's certainly up for discussion whether we would want to claim that "experimental" support means that you have to change the Python runtime defaults to get it to work)

If it's just related to the dictionary ordering, can we link that issue instead to #17758?

comment:5 by Anssi Kääriäinen, 11 years ago

It is dict-ordering only. Will make a mention in #17758.

comment:6 by Ian Clelland, 11 years ago

The import errors were also just a matter of Python changing the exception messages. An import error now surrounds the name of the module which did not load in single quotes; it was bare before.

comment:7 by Ian Clelland, 11 years ago

My github branch now passes the complete test suite under 3.3.0b1, with one exception, which is being tracked in #19039 -- I'd like to get some input on that before closing it out.

comment:8 by Jonas Obrist, 11 years ago

Cc: ojiidotch@… added

comment:9 by Claude Paroz, 11 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:10 by Claude Paroz <claude@…>, 11 years ago

In 117e99511e0985701780ed1bcd3afd456e244ae3:

Added assertXML[Not]Equal assertions

This is especially needed to compare XML when hash randomization
is on, as attribute order may vary. Refs #17758, #19038.
Thanks Taylor Mitchell for the initial patch, and Ian Clelland for
review and cleanup.

comment:11 by wiz, 11 years ago

Cc: aenor.realm@… added

comment:12 by Ian Clelland, 11 years ago

I've rebased the patch to not depend on the fix for #17758. WIth hash randomization disabled, this passes the entire test suite, except for the issue in #19039.

Pull request sent. (https://github.com/django/django/pull/435)

comment:13 by Claude Paroz <claude@…>, 11 years ago

In f7b69665fd0ce21adae7cfaed7fade63f8aae1fd:

Use renamed threading event API in Python 3.3

Refs #19038.

comment:14 by Luke Plant <L.Plant.98@…>, 11 years ago

In c8508943a2e69840e3ec3322dba98551cbb23a9b:

Fixed some test failures on Python 3.3 related to QueryDict

Refs #19038.

comment:15 by Luke Plant <L.Plant.98@…>, 11 years ago

In 3e10d22df5ce3a97d815b156bff11d879f40aa3a:

Fixed test failures on Python 3.3 due to dict ordering assumptions.

Refs #19038

comment:16 by Luke Plant <L.Plant.98@…>, 11 years ago

In f02f29dccc6207829f64156f539704125cdce75d:

[1.5.x] Fixed some test failures on Python 3.3 related to QueryDict

Refs #19038.

Backport of 1413ee0a1705beee0df1949b308cc52f2467b5d1 from master

comment:17 by Luke Plant <L.Plant.98@…>, 11 years ago

In 0efca2a8198f5e7a702c0fbb38be489a6bd23ef5:

[1.5.x] Fixed test failures on Python 3.3 due to dict ordering assumptions.

Refs #19038

Backport of c229f31118bd8a7494692a727860ed7cb58df232 from master

comment:18 by Aymeric Augustin, 11 years ago

Resolution: fixed
Status: newclosed

Unless I missed something, all the problems raised in this ticket have been fixed.

Test failures caused by hash randomization are tracked in #17758 (in general) and #18375 (for a specific ORM problem).

Since this ticket is becoming long, I recommend opening new tickets if new issues arise.

comment:19 by Luke Plant, 11 years ago

Forgot to mention on this ticket - I merged the pull request from clelland, thanks.

Note: See TracTickets for help on using tickets.
Back to Top