From 7dd22aa5813450ae933cb84c7bcd7c791e4b13ea Mon Sep 17 00:00:00 2001 From: Ole <4692497+Guacam-Ole@users.noreply.github.com> Date: Thu, 26 Nov 2026 16:07:53 +0100 Subject: [PATCH] Deck: make xml.etree optional, Decky's frozen Python ships no xml package Decky Loader 3.3.1 bundles its own Python 3.14 (PyInstaller) and plugin backends run inside it. That interpreter has no `xml` package, so `game_visuals.py` raised "No module named 'xml.etree'" on every get_card call and the game page never received a card. An import probe over all 95 stdlib modules the plugin uses showed xml.* as the only gap. ElementTree is only used to validate authored SVG rails. Without it the SVG rail is skipped (PNG rails keep working); nothing else changes. Co-Authored-By: Claude Fable 5.1 --- plugin/py_modules/game_visuals.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/py_modules/game_visuals.py b/plugin/py_modules/game_visuals.py index 65eb9be..23d9ffc 100644 --- a/plugin/py_modules/game_visuals.py +++ b/plugin/py_modules/game_visuals.py @@ -6,12 +6,15 @@ from pathlib import Path import re import struct -import xml.etree.ElementTree as ET +try: + import xml.etree.ElementTree as ET +except ImportError: # Decky's frozen Python ships no ``xml`` package; SVG rails are then skipped, PNG rails still work + ET = None def _static_svg(data): """Small authored rail vocabulary only: no code, raster, filters or references out.""" - if len(data) > 16384 or b' 16384 or b'