Skip to content

[docxodus] extra doesn't pin companion version: 0.3.0 wrapper + 1.0.0 binary fails on --engine, and the real error is hidden #34

Description

@Cyb3rN8

Summary

python-redlines==0.3.0 with the [docxodus] extra now resolves python-redlines-docxodus==1.0.0, because the extra has no version constraint (Requires-Dist: python-redlines-docxodus; extra == 'docxodus', in both 0.3.0 and 1.0.0). The 1.0.0 companion bundles a redline binary built on Docxodus v11, which removed --engine. The 0.3.0 wrapper still appends --engine=<name> whenever engine= is passed, so every such call fails:

python-redlines 0.3.0 / python-redlines-docxodus 1.0.0
subprocess.CalledProcessError: Command '[.../docxodus/1.0.0/osx-arm64/redline', '/var/folders/...', ...]' returned non-zero exit status 1.

The actual cause is only in e.stderr (Error: Unknown flag: --engine=wmlcomparer) and e.stdout (usage text). str(e) shows only the command line with temp paths, so it's hard to diagnose. #31 may be a case of this (it shows the same exception shape with the real message hidden).

Repro

# /// script
# dependencies = ["python-redlines[docxodus]==0.3.0", "python-docx"]
# ///
import io, subprocess, docx
from python_redlines.engines import DocxodusEngine
def make(t):
    d = docx.Document(); d.add_paragraph(t); b = io.BytesIO(); d.save(b); return b.getvalue()
try:
    DocxodusEngine().run_redline("x", original=make("a"), modified=make("b"), engine="wmlcomparer")
except subprocess.CalledProcessError as e:
    print(e.stderr)   # Error: Unknown flag: --engine=wmlcomparer

This affects anyone who pinned python-redlines==0.3.0 and built a fresh environment after 2026-09-06.

Suggestions

  1. Constrain the companion in the extra, e.g. python-redlines-docxodus==<same version> (or a compatible range), so a pinned wrapper can't pair with an incompatible binary.
  2. When the binary exits non-zero, include its stdout/stderr in the raised exception (for example, re-raise with e.stderr in the message).
  3. Optional: redline --version reports 1.1.0 for both the 0.3.0 and 1.0.0 companion binaries, even though their flag sets differ. The cache directory is named after the companion package version. Neither tells you what the binary supports, which made this harder to track down.

Workaround for users: pin both packages, python-redlines[docxodus]==0.3.0 and python-redlines-docxodus==0.3.0.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions