Commit Graph

45 Commits

Author SHA1 Message Date
Miss Islington (bot) 7ca17edd13
[3.13] gh-130999: Avoid exiting the new REPL when there are non-string candidates for suggestions (gh-131001) (gh-135020)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-06-02 16:58:29 +02:00
Miss Islington (bot) 08c9ba5b72
[3.13] gh-134097: Print number of refs & blocks after each statement in new REPL (gh-134136) (gh-134221)
(cherry picked from commit c31547a591)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 16:13:25 +02:00
Miss Islington (bot) a0dd4f0c56
[3.13] gh-133639: Fix `test_auto_indent_default()` doesn't run `input_code` (GH-133640) (#133647) 2025-05-08 08:47:38 +00:00
sobolevn ab89f6ec84
[3.13] gh-133054: Skip `test_pyrepl` tests when `cannot use pyrepl` is reported (GH-133055) (#133095)
(cherry picked from commit b739ec5ab7)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-28 18:00:42 +00:00
Miss Islington (bot) 62663bfed5
[3.13] gh-129098: avoid using content of `_pyrepl/__main__.py` when reporting tracebacks (GH-130721) (#132755)
gh-129098: avoid using content of `_pyrepl/__main__.py` when reporting tracebacks (GH-130721)
(cherry picked from commit 492e3e6976)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-20 17:48:16 +00:00
Łukasz Langa 095c1263eb
[3.13] gh-131507: Clean up tests and type checking for `_pyrepl` (GH-131509) (GH-131546)
(cherry picked from commit 5d8e981c84)
2025-03-21 17:25:45 +01:00
Miss Islington (bot) 5c102a12a1
[3.13] gh-118878: Pyrepl: show completions menu below the current line (GH-118939) (#129161)
gh-118878: Pyrepl: show completions menu below the current line (GH-118939)

(cherry picked from commit 29caec62ee)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-01-23 22:15:27 +01:00
Hugo van Kemenade cc3dc8ab24
[3.13] gh-127873: Only check `sys.flags.ignore_environment` for `PYTHON*` env vars (GH-127877) (#129138) 2025-01-22 21:09:51 +02:00
Miss Islington (bot) 67971cd605
[3.13] gh-128770: fix ResourceWarning in test_pyrepl (GH-128906) (#129179) 2025-01-22 13:13:08 +00:00
Miss Islington (bot) 0ddcb61ffe
[3.13] gh-123024: Correctly prepare/restore around help and show-history commands (GH-124485) (#129155)
gh-123024: Correctly prepare/restore around help and show-history commands (GH-124485)
(cherry picked from commit 5a9afe2362)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Emily Morehouse <emily@cuttlesoft.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-01-21 22:15:57 +00:00
Miss Islington (bot) fd48d98df9
[3.13] gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732) (#126023)
gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732)
(cherry picked from commit 44becb8cba)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2024-12-02 15:04:51 +01:00
Victor Stinner 5df6a756a5
[3.13] gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097) (#125111)
gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097)

If the PYTHON_BASIC_REPL environment variable is set, the site module
no longer imports the _pyrepl module.

Moreover, the site module now respects -E and -I command line
options: ignore PYTHON_BASIC_REPL in this case.

(cherry picked from commit 65ce228d63)
2024-10-08 14:20:05 +00:00
Miss Islington (bot) 9fc8771942
[3.13] gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search (GH-124396) (#124530)
gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search (GH-124396)
(cherry picked from commit c1600c78e4)

Co-authored-by: Emily Morehouse <emily@cuttlesoft.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-09-26 13:39:01 -07:00
Miss Islington (bot) 2cc1899b93
[3.13] gh-119310: Fix encoding when reading old history file (GH-121779) (#123784)
(cherry picked from commit e95984826e)

Co-authored-by: aorcajo <589252+aorcajo@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-09-06 16:23:47 +02:00
Miss Islington (bot) c787a5161c
[3.13] gh-119034, REPL: Change page up/down keys to search in history (GH-123607) (GH-123773)
Change <page up> and <page down> keys of the Python REPL to history
search forward/backward.

(cherry picked from commit 8311b11800)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-09-06 14:04:11 +02:00
Miss Islington (bot) b221c5bba1
[3.13] gh-111201: fix auto-indent in pyrepl for muliple pound comments (GH-123196) (GH-123764)
(cherry picked from commit d683f49a7b)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
2024-09-06 13:09:22 +02:00
Miss Islington (bot) 3b7e5b640f
[3.13] gh-123228: don't leak file descriptors in pyrepl test (GH-123302) (#123313) 2024-08-25 15:17:45 +00:00
Miss Islington (bot) 31fae8c94f
[3.13] gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() (GH-123281) (#123293)
gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() (GH-123281)
(cherry picked from commit ca18ff2a34)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2024-08-24 16:11:17 +00:00
CF Bolz-Tereick 0955db1bd8
[3.13] gh-82378 fix sys.tracebacklimit in pyrepl, approach 2 (GH-123062) (#123252)
Make sure that pyrepl uses the same logic for sys.tracebacklimit as both
the basic repl and the standard sys.excepthook
(cherry picked from commit 63603bca35)
2024-08-23 12:59:08 +01:00
Miss Islington (bot) fda8aec625
[3.13] gh-122546: Relax SyntaxError check when raising errors on the new REPL (GH-123233) (#123247)
gh-122546: Relax SyntaxError check when raising errors on the new REPL (GH-123233)
(cherry picked from commit 4c3f0cbeae)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-08-23 00:32:11 +00:00
Sergey B Kirpichev 5271f8fead
[3.13] gh-122546: use same filename for different exceptions in new repl (GH-123217) (#123226) 2024-08-23 00:28:09 +01:00
Miss Islington (bot) 84c8cd0f3d
[3.13] gh-87320: In the code module, handle exceptions raised in sys.excepthook (GH-122456) (GH-122514)
Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
(cherry picked from commit bd3d31f380)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
2024-08-08 07:26:52 +00:00
Miss Islington (bot) 214b430faf
[3.13] gh-121973: Fix flaky test_pyrepl tests (GH-122140) (GH-122173)
This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

(cherry picked from commit 2c1b1e7a07)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-23 15:57:24 +02:00
Miss Islington (bot) bd5121b1c0
[3.13] gh-121988: Fix test hang when pyrepl is not available (GH-121990) (#122064)
gh-121988: Fix test hang when pyrepl is not available (GH-121990)

Also explicitly fail the test if we timeout while waiting for output so
that this failure mode is caught earlier.
(cherry picked from commit a09e215abf)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-20 14:32:41 +00:00
Miss Islington (bot) 91e098f44d
[3.13] gh-120678: Guard against stdin.fileno() being unavailable (GH-121924) (#121929)
gh-120678: Guard against stdin.fileno() being unavailable (GH-121924)
(cherry picked from commit 19cbf8fd63)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-17 16:33:28 +00:00
Miss Islington (bot) 3d9692dbf8
[3.13] gh-120678: pyrepl: Include globals from modules passed with `-i` (GH-120904) (#121916)
(cherry picked from commit ac07451116)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-17 16:52:46 +02:00
Miss Islington (bot) 0201b98d4c
[3.13] gh-121605: Fix test hang when pyrepl is not available (GH-121820) (GH-121823)
The fallback repl does not support "exit" without parentheses, so the
test would hang until the timeout expired.
(cherry picked from commit 4134261ab8)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-16 01:15:18 +02:00
Miss Islington (bot) 2ee2bfe617
[3.13] gh-121359: make clean environment (no PYTHON* vars) for test_pyrepl.TestMain (GH-121672) (GH-121810)
(cherry picked from commit fd085a411e)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-15 22:32:28 +02:00
Miss Islington (bot) 14c5bffcc5
[3.13] gh-121605: Increase timeout in test_pyrepl.run_repl (GH-121606) (#121702)
We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
(cherry picked from commit abc3aeebdb)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-13 12:07:12 -04:00
Miss Islington (bot) de51ee0c23
[3.13] gh-121499: Fix multi-line history rendering in the REPL (GH-121531) (#121679)
gh-121499: Fix multi-line history rendering in the REPL (GH-121531)
(cherry picked from commit 4b9e10d0ea)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-07-13 15:56:56 +02:00
Miss Islington (bot) 2b02431dd1
[3.13] gh-121351: Skip test_not_wiping_history_file() if no readline (GH-121422) (#121449)
gh-121351: Skip test_not_wiping_history_file() if no readline (GH-121422)
(cherry picked from commit 68e279b37a)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-07-06 23:18:20 +00:00
Miss Islington (bot) 4aa0c5ec34
[3.13] gh-121359: Run test_pyrepl in isolated mode (GH-121414) (#121417)
gh-121359: Run test_pyrepl in isolated mode (GH-121414)

run_repl() now pass the -I option (isolated mode) to Python if the
'env' parameter is not set.
(cherry picked from commit 6239d41527)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-05 20:55:14 +00:00
Miss Islington (bot) 251667340e
[3.13] gh-121245: a regression test for site.register_readline() (GH-121259) (#121322) 2024-07-03 11:11:41 +00:00
devdanzin bc515b332b
[3.13] gh-121016: Add test for PYTHON_BASIC_REPL envioronment variable (GH-121017) (#121064)
* gh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (#121017)

(cherry picked from commit 9e45fd9858)

* [3.13] gh-121016: Add test for `PYTHON_BASIC_REPL` envioronment variable (GH-121017)
(cherry picked from commit 9e45fd9858)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2024-06-26 22:17:14 +01:00
Miss Islington (bot) 38cfa92880
[3.13] gh-118908: Use __main__ for the default PyREPL namespace (GH-121054) (#121059) 2024-06-26 19:25:38 +00:00
Miss Islington (bot) bb5d19440b
[3.13] gh-120635: Avoid leaking processes in test_pyrepl (GH-120676) (#120741)
gh-120635: Avoid leaking processes in test_pyrepl (GH-120676)

If the child process takes longer than SHORT_TIMEOUT seconds to
complete, kill the process but then wait until it completes with no
timeout to not leak child processes.
(cherry picked from commit 0f3e36454d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-19 13:38:37 +00:00
Miss Islington (bot) ff358616dd
[3.13] gh-118908: Protect the REPL subprocess with a timeout in tests (GH-120408) (#120430)
(cherry picked from commit 3453362183)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-06-12 21:58:29 +02:00
Miss Islington (bot) f5289c450a
[3.13] gh-118908: Limit exposed globals from internal imports and definitions on new REPL startup (GH-119547) (#120362) 2024-06-11 18:04:39 +00:00
Miss Islington (bot) d6faac6d1f
[3.13] gh-111201: Support pyrepl on Windows (GH-119559) (GH-119850)
(cherry picked from commit 0d07182821)

Co-authored-by: Dino Viehland <dinoviehland@gmail.com>
Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-31 17:18:28 +02:00
Miss Islington (bot) 38bf39cb4b
[3.13] gh-111201: Improve pyrepl auto indentation (GH-119606) (GH-119833)
- auto-indent when editing multi-line block
- ignore comments

(cherry picked from commit dae0375bd9)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
2024-05-31 11:51:53 +02:00
Miss Islington (bot) 58dbb4a4b0
[3.13] gh-111201: Speed up paste mode in the REPL (#119341) (GH-119432) (#119439)
(cherry picked from commit e6572e8f98)

Also includes:

* gh-111201: Use calc_complete_screen after bracketed paste in PyREPL (GH-119432)
(cherry picked from commit 14b063cbf1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2024-05-23 04:23:40 +00:00
Lysandros Nikolaou 9fa1b4fc46
[3.13] gh-118911: Trailing whitespace in a block shouldn't prevent the user from terminating the code block (GH-119355) (#119404)
(cherry picked from commit 5091c4400c)

Co-authored-by: Aya Elsayed <ayah.ehab11@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-23 00:12:26 -04:00
Lysandros Nikolaou 9435124d4a
[3.13] gh-111201: auto-indentation in _pyrepl (GH-119348) (#119427)
(cherry picked from commit cd516cd1f5)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 23:14:03 +02:00
Miss Islington (bot) eafd633fac
[3.13] gh-119205: Fix autocompletion bug in new repl (GH-119229) (#119407)
(cherry picked from commit 506b1a3ff6)

Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 16:07:38 +00:00
Lysandros Nikolaou 721459831a
[3.13] gh-119306: Break up _pyrepl tests (GH-119307) (#119362)
(cherry picked from commit f49df4f486)

Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
2024-05-22 11:02:18 -04:00