Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disable PyREPL by default to avoid breaking third party applications
  • Loading branch information
tanloong committed Apr 8, 2026
commit 970032b4a52f2e8a2f9f75381cfe21717600a470
8 changes: 4 additions & 4 deletions Lib/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def resetbuffer(self):
"""Reset the input buffer."""
self.buffer = []

def interact(self, banner=None, exitmsg=None, *, use_pyrepl=None):
def interact(self, banner=None, exitmsg=None, *, use_pyrepl=False):
"""Closely emulate the interactive Python console.

The optional banner argument specifies the banner to print
Expand All @@ -218,8 +218,8 @@ def interact(self, banner=None, exitmsg=None, *, use_pyrepl=None):
a default message is printed.

The use_pyrepl argument controls whether to use the pyrepl-based REPL
when available. When True, pyrepl is used. When False, the basic
readline-based REPL is used. When None (the default), pyrepl is used
when available. When True, pyrepl is used. When False (the default),
the basic readline-based REPL is used. When None, pyrepl is used
automatically if available and the PYTHON_BASIC_REPL environment
variable is not set.

Expand Down Expand Up @@ -378,7 +378,7 @@ def __call__(self, code=None):
raise SystemExit(code)


def interact(banner=None, readfunc=None, local=None, exitmsg=None, local_exit=False, *, use_pyrepl=None):
def interact(banner=None, readfunc=None, local=None, exitmsg=None, local_exit=False, *, use_pyrepl=False):
"""Closely emulate the interactive Python interpreter.

This is a backwards compatible interface to the InteractiveConsole
Expand Down