podman-container-tools/podman · error · Exception

This script accepts no arguments

Error message

This script accepts no arguments

What it means

Raised by main() when sys.argv has more than one element: this script deliberately accepts no command-line arguments. Older versions took arguments; the current contract is 'cd into docs/source/markdown and process all *.md.in files' with zero configuration. Any extra word (a file name, --help, a flag) aborts before processing.

Source

Thrown at hack/markdown-preprocess:284

                return rhs
            return lhs

        return re.sub(r'<<[^\|>]*\|[^\|>]*>>', replwith, line)


def main():
    "script entry point"
    script_dir = os.path.abspath(os.path.dirname(__file__))
    man_dir = os.path.join(script_dir,"../docs/source/markdown")

    try:
        os.chdir(man_dir)
    except FileNotFoundError as ex:
        raise Exception("Please invoke me from the base repo dir") from ex

    # No longer possible to invoke us with args: reject any such invocation
    if len(sys.argv) > 1:
        raise Exception("This script accepts no arguments")

    preprocessor = Preprocessor()
    for infile in sorted(glob.glob('*.md.in')):
        preprocessor.process(infile)

    # Now rewrite all option files
    preprocessor.rewrite_optionfiles()

if __name__ == "__main__":
    main()

View on GitHub (pinned to a2409076ef)

Solutions

  1. Call it bare: ./hack/markdown-preprocess (or python3 hack/markdown-preprocess)
  2. Update stale wrappers/Makefile snippets that pass file arguments
  3. To regenerate one man page, let the script run over all *.md.in — it is fast and idempotent

Example fix

# before
./hack/markdown-preprocess podman-run.1.md.in

# after
./hack/markdown-preprocess
Defensive patterns

Strategy: validation

Validate before calling

# Wrapper that enforces the no-args contract explicitly
import subprocess, sys
if len(sys.argv) != 1:
    sys.exit('markdown-preprocess takes no arguments; it processes all *.md.in files')
raise SystemExit(subprocess.run(['./hack/markdown-preprocess']).returncode)

Prevention

When it happens

Trigger: Invoking './hack/markdown-preprocess podman-run.1.md.in' or './hack/markdown-preprocess --help' or passing a wrapper script's stray argument; Makefile/custom target still using the old argument-based interface.

Common situations: Outdated docs/CI instructions or muscle memory from the old CLI; wrapper scripts that forward "$@"; automation appending flags.

Related errors


AI-assisted analysis of podman-container-tools/podman@a2409076ef (2026-08-15). Data as JSON: /api/errors/f2ee09b96458b042. Report an issue: GitHub.