Skip to content

componentize-py: WIT docs containing """ break generated Python bindings #194

Closed
cestercian/componentize-py
#1

Description

@kavoc-brown

Environment

  • componentize-py: 0.19.3
  • OS: Ubuntu 22.04.5 LTS (x86_64)

WIT

package demo:poc;

world example {
  /// """
  export hello: func(name: string) -> string;
}

Observed

python -m py_compile fails with a SyntaxError

Activity

  1. dicej commented on Jan 30, 2026

    @dicej
    Collaborator

    Thanks for reporting this. I'm not sure if there's a single "correct" way to address this, but one option would be to update the docstring function to replace every """ with e.g. ''' in the docs prior to emitting the docstring.

  2. cestercian commented on Aug 25, 2026

    @cestercian
    Contributor

    I'll take this. Plan is the approach @dicej suggested: escape """ in WIT docs inside docstring() (src/summary.rs) before emitting a Python triple-quoted docstring, plus a WIT fixture that currently SyntaxErrors under python -m py_compile.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions