{"record":{"id":"b91533b0cb5d8737","repo":"anthropics/skills","slug":"this-module-should-not-be-run-directly-b91533","errorCode":null,"errorMessage":"This module should not be run directly.","messagePattern":"This module should not be run directly\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"info","filePath":"skills/xlsx/scripts/office/validators/redlining.py","lineNumber":299,"sourceCode":"\n    def _extract_text_content(self, root):\n        p_tag = f\"{{{self.namespaces['w']}}}p\"\n        t_tag = f\"{{{self.namespaces['w']}}}t\"\n\n        paragraphs = []\n        for p_elem in root.findall(f\".//{p_tag}\"):\n            text_parts = []\n            for t_elem in p_elem.findall(f\".//{t_tag}\"):\n                text_parts.append(self._rendered_text(t_elem))\n            paragraph_text = \"\".join(text_parts)\n            if paragraph_text:\n                paragraphs.append(paragraph_text)\n\n        return \"\\n\".join(paragraphs)\n\n\nif __name__ == \"__main__\":\n    raise RuntimeError(\"This module should not be run directly.\")\n","sourceCodeStart":281,"sourceCodeEnd":300,"githubUrl":"https://github.com/anthropics/skills/blob/f6656c1256d5a8adfa37db9110046ef20bac644c/skills/xlsx/scripts/office/validators/redlining.py#L281-L300","documentation":"redlining.py is a library module of the office validators package; executing it as a script hits the __main__ guard and raises RuntimeError at once. Its tracked-change ('redline') extraction helpers are intended for import only.","triggerScenarios":"`python skills/xlsx/scripts/office/validators/redlining.py` from a shell; an IDE 'run current file'; a CI step that executes every discovered .py file.","commonSituations":"IDE run button; exploratory execution of files found via grep/glob; mistaken assumption that validators ship CLIs.","solutions":["Run the package entry-point script that imports redlining instead","For exploration, import the module and call its classes from a short driver snippet","Keep library modules out of execute-all automation"],"exampleFix":"# before\npython skills/xlsx/scripts/office/validators/redlining.py\n# after\npython -c \"import sys; sys.path.insert(0, 'skills/xlsx/scripts/office'); from validators import redlining\"  # import-only","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"# Nothing to catch — import redlining from a driver instead of running the file.","preventionTips":["Use the package driver script for any CLI workflow","Keep execute-all harnesses away from the validators package"],"tags":["module-guard","usage-error","python"],"backgroundTag":null,"analyzedSha":"f6656c1256d5a8adfa37db9110046ef20bac644c","analyzedAt":"2026-08-14T16:09:17.493Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}