diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c38e7332..1e7adbb1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,8 @@ jobs: - uses: "actions/setup-python@v2" with: python-version: "3.9" + - name: "Update package details" + run: sudo apt --fix-missing update - name: "Install Apache package" run: sudo apt install -y apache2-dev - name: "Build mod_wsgi packages" @@ -45,6 +47,8 @@ jobs: with: name: dist path: dist + - name: "Update package details" + run: sudo apt --fix-missing update - name: "Install Apache package" run: sudo apt install -y apache2-dev - name: "Update pip installation" diff --git a/docs/release-notes.rst b/docs/release-notes.rst index fa6d30c7..b7612bfa 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -5,6 +5,7 @@ Release Notes .. toctree:: :maxdepth: 2 + release-notes/version-4.9.2 release-notes/version-4.9.1 release-notes/version-4.9.0 diff --git a/docs/release-notes/version-4.9.2.rst b/docs/release-notes/version-4.9.2.rst new file mode 100644 index 00000000..2701dab7 --- /dev/null +++ b/docs/release-notes/version-4.9.2.rst @@ -0,0 +1,14 @@ +============= +Version 4.9.2 +============= + +Version 4.9.2 of mod_wsgi can be obtained from: + + https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.9.2 + +Bugs Fixed +---------- + +* When using ``mod_wsgi-express`` in daemon mode, and source code reloading + was enabled, an invalid URL path which contained a byte sequence which + could not be decoded as UTF-8 was causing a process crash. diff --git a/src/server/__init__.py b/src/server/__init__.py index fc632cf9..33f0fad3 100644 --- a/src/server/__init__.py +++ b/src/server/__init__.py @@ -1520,7 +1520,7 @@ def setup_debugger(self, startup): def setup_recorder(self, savedir): self.application = RequestRecorder(self.application, savedir) - def reload_required(self, environ): + def reload_required(self, resource): if self.debug_mode: return False @@ -1596,7 +1596,7 @@ def reload_required(self, resource): extension = self.resource_extension(resource) function = getattr(self.resources[extension], 'reload_required', None) if function is not None: - return function(environ) + return function(resource) return False def handle_request(self, environ, start_response): diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c index 59aad901..0123472b 100644 --- a/src/server/mod_wsgi.c +++ b/src/server/mod_wsgi.c @@ -3852,9 +3852,20 @@ static int wsgi_reload_required(apr_pool_t *pool, request_rec *r, if (object) { PyObject *args = NULL; PyObject *result = NULL; +#if PY_MAJOR_VERSION >= 3 + PyObject *path = NULL; +#endif Py_INCREF(object); +#if PY_MAJOR_VERSION >= 3 + path = PyUnicode_Decode(resource, strlen(resource), + Py_FileSystemDefaultEncoding, + "surrogateescape"); + args = Py_BuildValue("(O)", path); + Py_DECREF(path); +#else args = Py_BuildValue("(s)", resource); +#endif result = PyObject_CallObject(object, args); Py_DECREF(args); Py_DECREF(object); diff --git a/src/server/wsgi_version.h b/src/server/wsgi_version.h index 793ee810..ed8a9460 100755 --- a/src/server/wsgi_version.h +++ b/src/server/wsgi_version.h @@ -25,8 +25,8 @@ #define MOD_WSGI_MAJORVERSION_NUMBER 4 #define MOD_WSGI_MINORVERSION_NUMBER 9 -#define MOD_WSGI_MICROVERSION_NUMBER 1 -#define MOD_WSGI_VERSION_STRING "4.9.1" +#define MOD_WSGI_MICROVERSION_NUMBER 2 +#define MOD_WSGI_VERSION_STRING "4.9.2" /* ------------------------------------------------------------------------- */