Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19038 closed Uncategorized (fixed)

Add Experimental Support for Python 3.3

Reported by: Ian Clelland Owned by: nobody
Component: Python 3 Version: master
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 Changed 4 years ago by Ian Clelland

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

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 Changed 4 years ago by Aymeric Augustin

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 Changed 4 years ago by Anssi Kääriäinen

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 Changed 4 years ago by Ian Clelland

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 Changed 4 years ago by Anssi Kääriäinen

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

comment:6 Changed 4 years ago by Ian Clelland

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 Changed 4 years ago by Ian Clelland

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 Changed 4 years ago by Jonas Obrist

Cc: ojiidotch@… added

comment:9 Changed 4 years ago by Claude Paroz

Has patch: set
Triage Stage: UnreviewedAccepted

comment:10 Changed 4 years ago by Claude Paroz <claude@…>

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 Changed 4 years ago by wiz

Cc: aenor.realm@… added

comment:12 Changed 4 years ago by Ian Clelland

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 Changed 4 years ago by Claude Paroz <claude@…>

In f7b69665fd0ce21adae7cfaed7fade63f8aae1fd:

Use renamed threading event API in Python 3.3

Refs #19038.

comment:14 Changed 4 years ago by Luke Plant <L.Plant.98@…>

In c8508943a2e69840e3ec3322dba98551cbb23a9b:

Fixed some test failures on Python 3.3 related to QueryDict

Refs #19038.

comment:15 Changed 4 years ago by Luke Plant <L.Plant.98@…>

In 3e10d22df5ce3a97d815b156bff11d879f40aa3a:

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

Refs #19038

comment:16 Changed 4 years ago by Luke Plant <L.Plant.98@…>

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 Changed 4 years ago by Luke Plant <L.Plant.98@…>

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 Changed 4 years ago by Aymeric Augustin

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 Changed 4 years ago by Luke Plant

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