Skip to content

A comprehensive logo-design skill for Claude, Gemini CLI, Codex and other AI agents: principles, process, SVG craft, testing tools and a 1,400+ logo reference library.

Fix script crashes on Windows consoles and note the python3 stub (#1)

RossWarner2103552631b9df
diff --git a/skills/logo-design/SKILL.md b/skills/logo-design/SKILL.md
index 1a07716..01b1805 100644
--- a/skills/logo-design/SKILL.md
+++ b/skills/logo-design/SKILL.md
@@ -38,6 +38,7 @@ describe what the kit would contain.
All scripts are dependency-free Python 3 and live in this skill's `scripts/` folder (in Claude Code:
`${CLAUDE_SKILL_DIR}/scripts/`). Run them with `python3` and the full path, e.g.
`python3 <skill-dir>/scripts/svg_audit.py logo.svg` (examples below write `scripts/…` for brevity).
+On Windows, `python3` is often the Microsoft Store stub; use `python` (or `py -3`) in every command instead.
| Script | Use it to |
|---|---|
diff --git a/skills/logo-design/scripts/render_png.py b/skills/logo-design/scripts/render_png.py
index 93905a5..959b02a 100644
--- a/skills/logo-design/scripts/render_png.py
+++ b/skills/logo-design/scripts/render_png.py
@@ -30,6 +30,9 @@ import sys
import tempfile
import time
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+import svglib # noqa: E402,F401 (sets UTF-8 console output)
+
CHROME_CANDIDATES = [
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"/Applications/Chromium.app/Contents/MacOS/Chromium",
diff --git a/skills/logo-design/scripts/svglib.py b/skills/logo-design/scripts/svglib.py
index 831385c..97c29d8 100644
--- a/skills/logo-design/scripts/svglib.py
+++ b/skills/logo-design/scripts/svglib.py
@@ -8,8 +8,19 @@ import colorsys
import math
import os
import re
+import sys
import xml.etree.ElementTree as ET
+
+def _use_utf8_console():
+ # Windows consoles default to cp1252, which cannot print the reports' arrows and symbols.
+ for stream in (sys.stdout, sys.stderr):
+ if hasattr(stream, "reconfigure"):
+ stream.reconfigure(encoding="utf-8", errors="replace")
+
+
+_use_utf8_console()
+
SKILL_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
LIBRARY_DIR = os.path.join(SKILL_DIR, "assets", "library")
LIBRARY_SVG_DIR = os.path.join(LIBRARY_DIR, "svg")