mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-06 16:10:50 -05:00
The sandboxed Pyodide host (used when ENABLE_PYODIDE_FILE_PERSISTENCE is disabled, the default) embeds its script in a String.raw template. The matplotlib show() override was written with '\\t' escapes as if in a normal string context, but String.raw preserves them verbatim, so the iframe's script parser turns them into literal backslash-t characters in the generated Python source. Pyodide then fails to compile any code that triggers the matplotlib patch with "SyntaxError: unexpected character after line continuation character", which is why matplotlib only worked with the file persistence worker path enabled. Use single '\t' escapes instead: String.raw keeps them as-is in the script text and the sandbox's JS parser produces real tab indentation, matching the working implementation in pyodide.worker.ts. Fixes #26660