{"record":{"id":"6b60584a5219478e","repo":"Wox-launcher/Wox","slug":"usage-pathlib-path-sys-argv-0-name-source-png","errorCode":null,"errorMessage":"Usage: {pathlib.Path(sys.argv[0]).name} SOURCE_PNG DEST_ROOT ICON_FILE","messagePattern":"Usage: (.+?) SOURCE_PNG DEST_ROOT ICON_FILE","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"assets/linux/write_hicolor_icons.py","lineNumber":145,"sourceCode":"\n\ndef write_hicolor_icons(source_png: pathlib.Path, destination_root: pathlib.Path, icon_file: str) -> None:\n    \"\"\"Write 64, 128, and 256 PNG icons so local .rpm/.deb installs show the app icon.\"\"\"\n    width, height, rgba = decode_rgba_png(source_png)\n    if width != height:\n        raise SystemExit(f\"{source_png} must be square\")\n    for size in HICOLOR_SIZES:\n        if width % size != 0:\n            raise SystemExit(f\"{source_png} ({width}x{height}) cannot be boxed down to {size}x{size}\")\n        sized = box_downsample(rgba, width, height, width // size) if size != width else bytearray(rgba)\n        output_path = destination_root / f\"{size}x{size}\" / icon_file\n        output_path.parent.mkdir(parents=True, exist_ok=True)\n        output_path.write_bytes(encode_rgba_png(size, size, sized))\n\n\nif __name__ == \"__main__\":\n    if len(sys.argv) != 4:\n        raise SystemExit(f\"Usage: {pathlib.Path(sys.argv[0]).name} SOURCE_PNG DEST_ROOT ICON_FILE\")\n    write_hicolor_icons(pathlib.Path(sys.argv[1]), pathlib.Path(sys.argv[2]), sys.argv[3])\n","sourceCodeStart":127,"sourceCodeEnd":147,"githubUrl":"https://github.com/Wox-launcher/Wox/blob/1659730fcb37154f26497e07308b1f8789d659fe/assets/linux/write_hicolor_icons.py#L127-L147","documentation":"Error \"Usage: {pathlib.Path(sys.argv[0]).name} SOURCE_PNG DEST_ROOT ICON_FILE\" thrown in Wox-launcher/Wox.","triggerScenarios":"Thrown at assets/linux/write_hicolor_icons.py:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1659730fcb37154f26497e07308b1f8789d659fe","analyzedAt":"2026-08-15T23:31:07.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}