Skip to content

Commit 647b41f

Browse files
Merge branch 'release/mod_wsgi-6.0.4'
2 parents 8295f0f + e9bc4ce commit 647b41f

5 files changed

Lines changed: 46 additions & 5 deletions

File tree

docs/release-notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mod_wsgi. See :doc:`project-status` for the version support policy.
88
.. toctree::
99
:maxdepth: 2
1010

11+
release-notes/version-6.0.4
1112
release-notes/version-6.0.3
1213
release-notes/version-6.0.2
1314
release-notes/version-6.0.1

docs/release-notes/version-6.0.3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Version 6.0.3
55
Features Changed
66
----------------
77

8-
* `mod_wsgi-standalone` package has been updated to use `mod_wsgi-httpd-2.4.68.1`.
8+
* ``mod_wsgi-standalone`` package has been updated to use ``mod_wsgi-httpd-2.4.68.1``.
99
Apache 2.4.68 includes a range of CVE fixes as detailed in the
10-
[Apache HTTP Server 2.4.68 changelog](https://dlcdn.apache.org/httpd/CHANGES_2.4.68).
10+
`Apache HTTP Server 2.4.68 changelog <https://dlcdn.apache.org/httpd/CHANGES_2.4.68>`_.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
=============
2+
Version 6.0.4
3+
=============
4+
5+
Bugs Fixed
6+
----------
7+
8+
* The Django ``runmodwsgi`` management command was broken and would fail
9+
immediately with ``AttributeError: module 'mod_wsgi.express' has no
10+
attribute 'options'``. The command referenced the ``mod_wsgi.express.options``
11+
and ``mod_wsgi.express.server`` submodules without importing them. As Django
12+
builds the argument parser on every invocation, this affected all uses of the
13+
command and not just ``runmodwsgi --help``.
14+
15+
* The Django ``runmodwsgi`` management command failed with ``ValueError:
16+
unsupported format character`` when displaying help. The optparse option
17+
help text is now escaped and translated correctly when it is converted to
18+
the argparse form Django requires, so literal ``%`` characters such as the
19+
``%{GLOBAL}`` token and the ``%default`` token are handled properly.
20+
21+
* The Django ``runmodwsgi`` management command raised ``NameError: name
22+
'value' is not defined`` when validating percentage style options such as
23+
``--initial-workers``. The value is now parsed and range checked correctly.

src/express/management/commands/runmodwsgi.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
from django.core.management.base import BaseCommand, CommandError
88

99
import mod_wsgi.express
10+
import mod_wsgi.express.options
11+
import mod_wsgi.express.server
1012

1113
def check_percentage(string):
12-
if value is not None and value < 0 or value > 1:
14+
value = float(string)
15+
if value < 0 or value > 1:
1316
import argparse
1417
msg = '%s option value needs to be within the range 0 to 1.' % string
1518
raise argparse.ArgumentTypeError(msg)
@@ -48,6 +51,20 @@ def add_arguments(self, parser):
4851
elif attr == 'default':
4952
if getattr(option, attr) != ('NO', 'DEFAULT'):
5053
kwargs[attr] = getattr(option, attr)
54+
elif attr == 'help':
55+
# optparse displays help text literally, but
56+
# argparse expands it with '%'-formatting. Escape
57+
# any literal '%' (e.g. the '%{GLOBAL}' token) and
58+
# translate the optparse '%default'/'%prog' tokens
59+
# to their argparse equivalents.
60+
help_text = getattr(option, attr)
61+
if help_text is not None:
62+
help_text = help_text.replace('%', '%%')
63+
help_text = help_text.replace(
64+
'%%default', '%(default)s')
65+
help_text = help_text.replace(
66+
'%%prog', '%(prog)s')
67+
kwargs[attr] = help_text
5168
else:
5269
if getattr(option, attr) is not None:
5370
kwargs[attr] = getattr(option, attr)

src/server/wsgi_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#define MOD_WSGI_MAJORVERSION_NUMBER 6
2727
#define MOD_WSGI_MINORVERSION_NUMBER 0
28-
#define MOD_WSGI_MICROVERSION_NUMBER 3
29-
#define MOD_WSGI_VERSION_STRING "6.0.3"
28+
#define MOD_WSGI_MICROVERSION_NUMBER 4
29+
#define MOD_WSGI_VERSION_STRING "6.0.4"
3030

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

0 commit comments

Comments
 (0)