Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.13 #49970

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Add support for Python 3.13 #49970

wants to merge 9 commits into from

Conversation

jgraham
Copy link
Contributor

@jgraham jgraham commented Jan 8, 2025

Notably this involves vendoring a copy of the removed cgi module from stdlib.

This code has been dropped from Python 3.13, but we depend on
FieldStorage as part of the request API. The easiest option here is to
directly import the code that we are already using (the last version
on the 3.12 branch, but with the deprecation warning removed), along
with a copy of the PSF License which covers the cgi module code.
…ck API

This is required since the logging module started using the lock as a context manager,
and calling the acquire and release methods.
Remove code only needed for Python < 3.4 and ensure that we always use the spawn
form of multiprocessing to avoid problems with fork and locks.
Copy link
Member

@gsnedders gsnedders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should also vendor the cgi tests, for the sake of any changes we make to it?

Comment on lines +7 to +8
pillow==10.4.0; python_version < '3.13'
pillow==11.1.0; python_version >= '3.13'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to just make this python_version < '3.9', which means 3.8 (which I think we're closing to dropping support for?) is the only outlier?

@@ -77,7 +77,7 @@ def __init__(self, queue, level=logging.NOTSET):

def createLock(self):
# The queue provides its own locking
self.lock = None
self.lock = NullLock()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What motivates this change? This doesn't look like it should be related to Python 3.13 changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants