anthropics/skills · error · ValueError

relationship target is not a POSIX part name: {target!r}

Error message

relationship target is not a POSIX part name: {target!r}

What it means

Identical guard to error 3, in the pptx copy of office/helpers: opc_target() converts a relationship Target into a POSIX OPC part name and rejects any target containing a backslash, since OPC part names are forward-slash only. A backslash indicates a Windows-style path written by a non-conformant producer; guessing a conversion could resolve to the wrong part.

Source

Thrown at skills/pptx/scripts/office/helpers/__init__.py:35

}

_SCHEME_RE = re.compile(r"^[A-Za-z][A-Za-z0-9+.\-]*:")

SLIDE_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"


def opc_target(target: str, source_part: str, target_mode: str = "") -> str | None:
    if not target:
        return None
    if target_mode.lower() == "external":
        return None
    if _SCHEME_RE.match(target):
        return None

    target = urllib.parse.unquote(target)

    if "\\" in target:
        raise ValueError(f"relationship target is not a POSIX part name: {target!r}")

    if target.startswith("/"):
        joined = target.lstrip("/")
    else:
        joined = posixpath.join(posixpath.dirname(source_part), target)

    parts: list[str] = []
    for segment in posixpath.normpath(joined).split("/"):
        if segment in ("", "."):
            continue
        if segment == "..":
            if not parts:
                raise ValueError(f"relationship target escapes the package: {target!r}")
            parts.pop()
        else:
            parts.append(segment)

    if not parts:

View on GitHub (pinned to f6656c1256)

Solutions

  1. Repair the .rels: replace backslashes with forward slashes in the Target attribute the message names.
  2. Re-save the deck with PowerPoint/LibreOffice to rewrite relationships conformantly.
  3. Pre-validate: scan all .rels targets for '\\' before invoking the pipeline and reject/repair such files.
  4. Report the bug to the generator that produced the deck.

Example fix

# repair step before processing
import re, pathlib
for rels in unpacked.rglob("*.rels"):
    p = pathlib.Path(rels)
    p.write_text(p.read_text(encoding="utf-8").replace("Target=\"..\\\\", "Target=\"../"), encoding="utf-8")
Defensive patterns

Strategy: validation

Validate before calling

import zipfile, re

def rels_have_backslash_targets(path: str) -> bool:
    with zipfile.ZipFile(path) as zf:
        return any(
            b"\\" in m.group(1)
            for name in zf.namelist() if name.endswith(".rels")
            for m in re.finditer(rb'Target="([^"]*)"', zf.read(name))
        )

Try / catch

try:
    opc_target(target, source_part, target_mode)
except ValueError as e:
    if "not a POSIX part name" in str(e):
        opc_target(target.replace("\\", "/"), source_part, target_mode)  # logged repair
    else:
        raise

Prevention

When it happens

Trigger: Processing a PPTX whose .rels files contain targets like "..\\media\\image1.png" — hit by thumbnail.py (get_slide_info reads ppt/_rels/presentation.xml.rels) and clean.py during referenced-file collection.

Common situations: Decks from third-party converters or report tools writing Windows paths; files round-tripped through zip tools on Windows; fuzzed/malformed inputs.

Related errors


AI-assisted analysis of anthropics/skills@f6656c1256 (2026-08-14). Data as JSON: /api/errors/90981bc9a82b4b36. Report an issue: GitHub.