Skip to content

A multipart action form needs python-multipart, which the actions docs never mention #83

Closed

Description

@Espoir-Loem

What happens

An action called from a form sent as multipart/form-data, for example a form with a file input, goes through request.form() in nexy/modules/routers/actions/endpoint.py (_payload). Starlette's request.form() asserts that python-multipart is installed (starlette/requests.py: "The python-multipart library must be installed to use form parsing."). Nexy does not depend on python-multipart, so in a project without it the call should fail with a 500.

A form sent as application/x-www-form-urlencoded is parsed with parse_qsl and is not affected.

Where it is documented

python-multipart is mentioned for Form/File/UploadFile (docs/reference/python-api.md) and for uploads (docs/guides/recipes.md), but not in docs/guides/actions.md.

Done when

  • A multipart action call without python-multipart answers a clear error that names the package, not a bare 500. The dev log says uv add python-multipart.
  • docs/guides/actions.md says when the package is needed.
  • A test covers the missing-package case.

Activity

  1. added
    bug
    good first issue
    on Nov 5, 2026
  2. dbdefault commented on Nov 12, 2026

    @dbdefault

    I'll take this issue. I'll fork the repo and start working on it.

  3. Espoir-Loem commented on Nov 12, 2026

    @Espoir-Loem
    MemberAuthor

    Thanks both for offering to take this, and sorry for the silence — I have been quite busy lately and did not update the issue after starting on it myself.

    The fix is done on fix/actions-multipart-error and proposed in #357: the actions endpoint checks for python-multipart before parsing a multipart body, the error names uv add python-multipart, the actions guide and the Python API reference say when the package is needed, and the tests cover the missing-package case. Once #357 lands this issue closes.

    @tharunsridhar, please do not feel you lost work for nothing — thank you for the offer and for the interest in Nexy. Two good first issues are still open and unassigned if you would like another: #304 (four config hooks missing from the reference) and #302 ([[...slug]] not documented). And @dbdefault, the same goes for you — thanks for the PR, and you are very welcome to pick up #304 or #302 next.

  4. self-assigned this
    on Nov 12, 2026
  5. Espoir-Loem commented on Nov 12, 2026

    @Espoir-Loem
    MemberAuthor

    Fixed by #357, merged into develop.

    A multipart action form sent without python-multipart now raises a 500 whose message names the package and the command to install it (uv add python-multipart), instead of a traceback that buried it. Url-encoded forms still need nothing.

    The docs cover it too: docs/guides/actions.md says when the package is needed, and the Form / File / UploadFile row of the reference now names multipart bodies, translations included.

    Closing as completed — it ships in the next release.

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

Metadata

Metadata

Assignees

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions