Skip to content

fix(desktop): stop pruning _pyrepl from Windows/Linux stdlib#31

Merged
FeodorFitsner merged 1 commit into
mainfrom
fix/desktop-pyrepl-prune
Jul 19, 2026
Merged

fix(desktop): stop pruning _pyrepl from Windows/Linux stdlib#31
FeodorFitsner merged 1 commit into
mainfrom
fix/desktop-pyrepl-prune

Conversation

@FeodorFitsner

Copy link
Copy Markdown
Contributor

Problem

Windows/Linux desktop apps built with Python 3.14 crash on startup when the app (or a dependency) imports pydoc:

File ".../Lib/pydoc.py", line 81, in <module>
ModuleNotFoundError: No module named '_pyrepl'

CPython 3.14's pydoc.py — and pdb.py — import _pyrepl at module load. The Windows and Linux Dart stdlib excludes prune Lib/_pyrepl as a "dev-only / interactive-REPL" module, so any desktop app importing pydoc/pdb/pytest (or a lib that does, e.g. NLTK) dies with ModuleNotFoundError: No module named '_pyrepl'.

Fix

Stop pruning _pyrepl in windows/python-windows-dart.exclude and linux/python-linux-dart.exclude.

macOS/iOS/Android already un-pruned it in the mobile fix (#29, which cited pdb); this extends the same treatment to desktop and updates all comments to also cite pydoc, the trigger reported here.

Fixes flet-dev/serious-python#236

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
@FeodorFitsner
FeodorFitsner merged commit df4665d into main Jul 19, 2026
9 of 20 checks passed
@FeodorFitsner
FeodorFitsner deleted the fix/desktop-pyrepl-prune branch July 19, 2026 21:15
FeodorFitsner added a commit to flet-dev/serious-python that referenced this pull request Jul 19, 2026
…import, #236) (#237)

Windows/Linux desktop apps on Python 3.14 crashed at startup with
ModuleNotFoundError: No module named '_pyrepl' when the app or a dependency
(e.g. NLTK) imports pydoc/pdb — 3.14's pydoc/pdb import _pyrepl at module
load, but it was pruned from the desktop stdlib as a dev-only module.

python-build 20260719 un-prunes _pyrepl on Windows/Linux (flet-dev/python-build#31);
iOS/macOS/Android already shipped it (4.3.2), so those runtimes are byte-identical
to 20260714. Folded into the not-yet-released 4.3.4.

Fixes #236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_pyrepl/pydoc import error in build

1 participant