Skip to content

Commit 6421db9

Browse files
Eliminate invalid log object errors due to GC changes in Python 3.13.
1 parent 0232519 commit 6421db9

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

docs/release-notes.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Release Notes
55
.. toctree::
66
:maxdepth: 2
77

8+
release-notes/version-5.0.2
89
release-notes/version-5.0.1
910
release-notes/version-5.0.0
1011

docs/release-notes/version-5.0.2.rst

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
=============
2+
Version 5.0.2
3+
=============
4+
5+
Version 5.0.2 of mod_wsgi can be obtained from:
6+
7+
https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/5.0.2
8+
9+
Bugs Fixed
10+
----------
11+
12+
* Eliminate noise in logs under Python 3.13 when Python garbage collection
13+
decides to delay destruction of objects until a second phase, resulting in
14+
the `wsgi.errors` log object being accessed after the request had been
15+
completed and the log object marked as invalid. This resulted due to changes
16+
in garbage collection behaviour in Python 3.13.

src/server/wsgi_logger.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static PyObject *Log_flush(LogObject *self, PyObject *args)
176176
if (thread_info && thread_info->log_buffer)
177177
return Log_flush((LogObject *)thread_info->log_buffer, args);
178178

179-
if (self->expired) {
179+
if (self->expired && self->s) {
180180
PyErr_SetString(PyExc_RuntimeError, "log object has expired");
181181
return NULL;
182182
}

src/server/wsgi_version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#define MOD_WSGI_MAJORVERSION_NUMBER 5
2727
#define MOD_WSGI_MINORVERSION_NUMBER 0
28-
#define MOD_WSGI_MICROVERSION_NUMBER 1
29-
#define MOD_WSGI_VERSION_STRING "5.0.1"
28+
#define MOD_WSGI_MICROVERSION_NUMBER 2
29+
#define MOD_WSGI_VERSION_STRING "5.0.2"
3030

3131
/* ------------------------------------------------------------------------- */
3232

0 commit comments

Comments
 (0)