Opened 4 years ago

Closed 3 years ago

Last modified 2 years ago

#32074 closed New feature (fixed)

Python 3.10 compatibility

Reported by: Mariusz Felisiak Owned by: Mariusz Felisiak
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Mariusz Felisiak)

Python 3.10 final is scheduled for October 2021 (see PEP 619). This is a tracking ticket for compatibility fixes for Django submitted in the meantime.

Django 3.2 will be the first version to support Python 3.10.

Change History (33)

comment:1 by Mariusz Felisiak, 4 years ago

Description: modified (diff)

comment:2 by Carlton Gibson <carlton@…>, 3 years ago

In 1fd9b44:

Refs #32074 -- Fixed handling memoryview content by HttpResponse on Python 3.10+.

An iterator was added to memoryview in Python 3.10,
see https://bugs.python.org/issue41732

Refs #30294

comment:3 by Mariusz Felisiak, 3 years ago

Subclassing models.Choices with ipaddress.IPv4Network/IPv6Network raises TypeError on Python3.10.0a4 (it works properly in Python3.10.0a3), see https://bugs.python.org/issue42851

comment:4 by Carlton Gibson <carlton@…>, 3 years ago

In 5d9b065d:

Refs #32074 -- Fixed TextChoices/IntegerChoices crash on Python 3.10.

EnumMeta has a new keyword argument 'boundary' in Python 3.10. This
is a new mechanism that controls how out-of-range / invalid bits are
handled, see https://bugs.python.org/issue38250.

comment:5 by Carlton Gibson <carlton.gibson@…>, 3 years ago

In ff25791d:

[3.2.x] Refs #32074 -- Fixed TextChoices/IntegerChoices crash on Python 3.10.

EnumMeta has a new keyword argument 'boundary' in Python 3.10. This
is a new mechanism that controls how out-of-range / invalid bits are
handled, see https://bugs.python.org/issue38250.

Backport of 5d9b065d3f93de056588dfee6f1776294dd8bab2 from master

comment:6 by GitHub <noreply@…>, 3 years ago

In c6859f1a:

Refs #32074 -- Backported Enum.repr() from Python 3.10.

Enum.repr() was changed in [1], we should use the same format in
Python < 3.10.

[1] https://bugs.python.org/issue40066

comment:7 by GitHub <noreply@…>, 3 years ago

In 619f26d2:

Refs #32074 -- Made ExclusionConstraint.repr() use Deferrable.repr().

Follow up to c6859f1a684edec7bb33038b4408046a4db0c16d.

comment:8 by GitHub <noreply@…>, 3 years ago

In b8c9e9f:

Refs #32074 -- Removed usage of Python's deprecated distutils.version package.

The distutils package was formally deprecated in Python 3.10 and will
be removed in Python 3.12.

comment:9 by GitHub <noreply@…>, 3 years ago

In 623c8cd8:

Refs #32074 -- Used asyncio.get_running_loop() instead of get_event_loop().

Using asyncio.get_event_loop() when there is no running event loop was
deprecated in Python 3.10, see https://bugs.python.org/issue39529.

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In f9f6bd6:

Refs #32074 -- Removed usage of deprecated Thread.setDaemon().

Thread.setDaemon() was deprecated in Python 3.10 and will be removed in
Python 3.12.

comment:11 by GitHub <noreply@…>, 3 years ago

In 0250340:

Refs #32074 -- Used Enum.repr() format proposed for Python 3.10.

The Python's Steering Council decided to revert changes in the Enum
module (see https://bugs.python.org/issue44559) and moved them to
Python 3.11.

Follow up to 5d9b065d3f93de056588dfee6f1776294dd8bab2.

Thanks Nick Pope for the review.

comment:12 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 7afca03c:

Refs #32074 -- Fixed CommandTests.test_subparser_invalid_option on Python 3.10+.

Python 3.10.0rc1 changed the error messages issued by argparse on
invalid choice to include the argument name. Update the expected test
output to account for that.

comment:13 by GitHub <noreply@…>, 3 years ago

In f1bcaa9b:

Refs #32074 -- Fixed find_module()/find_loader() warnings on Python 3.10+.

comment:14 by Mariusz Felisiak, 3 years ago

Owner: changed from nobody to Mariusz Felisiak
Status: newassigned
Triage Stage: Someday/MaybeAccepted

comment:15 by GitHub <noreply@…>, 3 years ago

In 15987c9c:

Refs #32074 -- Added Python 3.10 to classifiers and tox.ini.

comment:16 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In c8d0a8c9:

[4.0.x] Refs #32074 -- Added Python 3.10 to classifiers and tox.ini.

Backport of 15987c9c5315ac30f069915e28de78ade788458d from main

comment:17 by Mariusz Felisiak, 3 years ago

Resolution: fixed
Status: assignedclosed

comment:18 by Claude Paroz, 3 years ago

From the ticket description: Django 3.2 will be the first version to support Python 3.10.

Is that still a goal?

comment:19 by Mariusz Felisiak, 3 years ago

Resolution: fixed
Status: closednew

Is that still a goal?

Yes, working on this. Sorry, shouldn't closed this ticket so soon.

comment:20 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 8bebb1c0:

[3.2.x] Refs #32074 -- Removed usage of Python's deprecated distutils.version package.

The distutils package was formally deprecated in Python 3.10 and will
be removed in Python 3.12.
Backport of b8c9e9fae14676d2e81242cb8df1e2eeef9c3a2d from main

comment:21 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In d0dc4464:

[3.2.x] Refs #32074 -- Removed usage of deprecated Thread.setDaemon().

Thread.setDaemon() was deprecated in Python 3.10 and will be removed in
Python 3.12.

Backport of f9f6bd63c98dc2f01412887f4a98dbfdab363fdf from main

comment:22 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In f6726fd:

[3.2.x] Refs #32074 -- Fixed find_module()/find_loader() warnings on Python 3.10+.

Backport of f1bcaa9be8227dce89a320ce1ca37e1df7c80d03 from main.

comment:23 by GitHub <noreply@…>, 3 years ago

In 53fad80:

[3.2.x] Refs #32074 -- Used asyncio.get_running_loop() instead of get_event_loop() on Python 3.7+.

Using asyncio.get_event_loop() when there is no running event loop was
deprecated in Python 3.10, see https://bugs.python.org/issue39529.

comment:24 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 1aed4663:

[3.2.x] Refs #32074 -- Added Python 3.10 to classifiers and tox.ini.

Backport of 15987c9c5315ac30f069915e28de78ade788458d from main.

comment:25 by GitHub <noreply@…>, 3 years ago

In 604df4e0:

Refs #32074 -- Doc'd Python 3.10 compatibility in Django 3.2.x.

comment:26 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In ab07cb4b:

[4.0.x] Refs #32074 -- Doc'd Python 3.10 compatibility in Django 3.2.x.

Backport of 604df4e0adc71da264f61fe85020a170c98e6f09 from main.

comment:27 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 82fee04:

[3.2.x] Refs #32074 -- Doc'd Python 3.10 compatibility in Django 3.2.x.

Backport of 604df4e0adc71da264f61fe85020a170c98e6f09 from main.

comment:28 by Mariusz Felisiak, 3 years ago

Resolution: fixed
Status: newclosed

comment:29 by GitHub <noreply@…>, 3 years ago

In 569a3357:

Refs #32074 -- Removed usage of deprecated asyncore and smtpd modules.

asyncore and smtpd modules were deprecated in Python 3.10.

comment:30 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 6a16d53:

[4.0.x] Refs #32074 -- Removed usage of deprecated asyncore and smtpd modules.

asyncore and smtpd modules were deprecated in Python 3.10.
Backport of 569a33579c3cca5f801c544d9b52a34e3c779424 from main

comment:31 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In dbcd8184:

[3.2.x] Refs #32074 -- Removed usage of deprecated asyncore and smtpd modules.

asyncore and smtpd modules were deprecated in Python 3.10.

Backport of 569a33579c3cca5f801c544d9b52a34e3c779424 from main.

comment:32 by GitHub <noreply@…>, 2 years ago

In 5d13cc5:

Refs #32074 -- Recommended aiosmtpd for minimal SMTP server.

Follow up to 569a33579c3cca5f801c544d9b52a34e3c779424.

comment:33 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

In 11881ad6:

[4.0.x] Refs #32074 -- Recommended aiosmtpd for minimal SMTP server.

Follow up to 569a33579c3cca5f801c544d9b52a34e3c779424.
Backport of 5d13cc540e29eedafe695338d8ec9ec500185ccd from main

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