Skip to content

Fix syntax error in the example WSGI adapter - #849

Merged
jacebrowning merged 1 commit into
doorstop-dev:developfrom
WynandVStaden:fix/example-wsgi-adapter-syntax
Oct 9, 2026
Merged

jacebrowning merged 1 commit into
doorstop-dev:developfrom
WynandVStaden:fix/example-wsgi-adapter-syntax

Conversation

@WynandVStaden

Copy link
Copy Markdown
Contributor

Fixes #842.

docs/web.md tells users to copy bin/example-adapter.wsgi, but the file cannot be imported. The parameter list is missing a comma after baseurl:

parameters = [
    '--project', project_path,
    '--baseurl', baseurl
    '--wsgi'
]

Python reports SyntaxError: invalid syntax on the '--wsgi' line.

Change

  • bin/example-adapter.wsgi: add the comma.
  • doorstop/server/tests/test_server.py: a small TestExampleAdapter test that compiles the example file, so a typo there is caught by the unit tests. It skips itself when bin/ is not present, since that directory is only in a source checkout.

I checked the three flags against doorstop/server/main.py; --project, --baseurl and --wsgi are all still accepted, so nothing else in the example needed changing.

How I checked

On Windows 11, Python 3.14:

  • The new test fails on develop with the SyntaxError and passes with the fix.
  • pytest doorstop/server/tests/test_server.py: 30 passed.
  • pytest doorstop: 758 passed, 112 skipped, 4 failed. The same 4 tests fail on unmodified develop on this machine (757 passed there); they are the HTML publisher and template tests and are not touched by this change.
  • black --check, isort --check-only, pylint --rcfile=.pylint.ini and pydocstyle on the changed test file, and mypy doorstop/server: clean.

I did not deploy the adapter under Apache/mod_wsgi; the check is that the file now compiles and its arguments match the server's parser.

The parameter list in bin/example-adapter.wsgi was missing a comma after
the base URL, so the file the deployment guide tells users to copy could
not be imported.

Add the comma, and a test that compiles the example so it stays valid.

Fixes doorstop-dev#842
@jacebrowning
jacebrowning self-requested a review October 6, 2026 16:11
@jacebrowning
jacebrowning merged commit c944c86 into doorstop-dev:develop Oct 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants