From afbd6d72cbc07f6a0feda9028a3f81b3c846aa63 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Sun, 19 Jul 2026 14:14:11 -0700 Subject: [PATCH] fix(desktop): stop pruning _pyrepl from Windows/Linux stdlib CPython 3.14's pydoc (and pdb) import _pyrepl at module load, so pruning it breaks any desktop app importing pydoc/pdb/pytest with: ModuleNotFoundError: No module named '_pyrepl' Un-prune _pyrepl in the Windows and Linux Dart excludes. macOS/iOS/Android already un-pruned it (mobile fix #29); their comments now also cite pydoc. Fixes flet-dev/serious-python#236 --- android/python-android-dart.exclude | 3 ++- darwin/python-darwin-stdlib.exclude | 4 ++-- linux/python-linux-dart.exclude | 3 ++- windows/python-windows-dart.exclude | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/android/python-android-dart.exclude b/android/python-android-dart.exclude index 2d95dbd..818ba32 100644 --- a/android/python-android-dart.exclude +++ b/android/python-android-dart.exclude @@ -21,7 +21,8 @@ lib/python*/turtle* lib/python*/wsgiref # Interactive-REPL / dev-only modules + easter eggs / frozen demos (never imported when # running a script in embedded mode). _pyrepl is intentionally NOT pruned: CPython 3.14's -# pdb imports it at module load, so dropping it breaks pdb / pytest / anything that imports it. +# pydoc and pdb import it at module load, so dropping it breaks pydoc / pdb / pytest / +# anything that imports them. lib/python*/rlcompleter* lib/python*/tabnanny* lib/python*/antigravity* diff --git a/darwin/python-darwin-stdlib.exclude b/darwin/python-darwin-stdlib.exclude index 03fb233..c37693d 100644 --- a/darwin/python-darwin-stdlib.exclude +++ b/darwin/python-darwin-stdlib.exclude @@ -20,8 +20,8 @@ turtle* wsgiref # Interactive-REPL / dev-only modules — never imported when running a script (embedded # mode); plus easter eggs and frozen demo modules. _pyrepl is intentionally NOT pruned: -# CPython 3.14's pdb imports it at module load, so dropping it breaks pdb / pytest / -# anything that imports it on-device. +# CPython 3.14's pydoc and pdb import it at module load, so dropping it breaks +# pydoc / pdb / pytest / anything that imports them. rlcompleter* tabnanny* antigravity* diff --git a/linux/python-linux-dart.exclude b/linux/python-linux-dart.exclude index b9192d2..b9d81be 100644 --- a/linux/python-linux-dart.exclude +++ b/linux/python-linux-dart.exclude @@ -20,7 +20,8 @@ lib/python*/turtle* lib/python*/wsgiref # Interactive-REPL / dev-only modules + easter eggs / frozen demos (never imported when # running a script in embedded mode). Globs catch the .pyc too (sources go via *.py above). -lib/python*/_pyrepl +# _pyrepl is intentionally NOT pruned: CPython 3.14's pydoc and pdb import it at module +# load, so dropping it breaks pydoc / pdb / pytest / anything that imports them. lib/python*/rlcompleter* lib/python*/tabnanny* lib/python*/antigravity* diff --git a/windows/python-windows-dart.exclude b/windows/python-windows-dart.exclude index 95657b4..cfedd89 100644 --- a/windows/python-windows-dart.exclude +++ b/windows/python-windows-dart.exclude @@ -13,7 +13,8 @@ Lib/site-packages/pip* Lib/site-packages/setuptools* Lib/site-packages/wheel* # Interactive-REPL / dev-only modules + easter eggs / frozen demos. -Lib/_pyrepl +# _pyrepl is intentionally NOT pruned: CPython 3.14's pydoc and pdb import it at +# module load, so dropping it breaks pydoc / pdb / pytest / anything that imports them. Lib/rlcompleter.py Lib/tabnanny.py Lib/antigravity.py