summaryrefslogtreecommitdiffstats
path: root/Lib/_pyrepl
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-134466: Don't run when termios is inaccessible (GH-138911) (GH-139030)Łukasz Langa2025-09-172-40/+59
| | | | | | | | Without the ability to set required capabilities, the REPL cannot function properly (syntax highlighting and multiline editing can't work). We refuse to work in this degraded state. (cherry picked from commit 2fc7004d5437e7bb0a1f5b962be441ef0ee7434b)
* [3.13] gh-135329: prevent infinite traceback loop on Ctrl-C for strace (#138974)Łukasz Langa2025-09-161-2/+15
| | | | | | | | | Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: dura0ok <slpmcf@gmail.com> Co-authored-by: graymon <greyschwinger@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit b9dbf6acb34fd407d52899a6c154a1c57c9a424b)
* [3.13] gh-128636: Fix crash in PyREPL when os.environ is overwritten with an ↵Łukasz Langa2025-09-151-2/+6
| | | | | | | | | invalid value for macOS (GH-138089) (GH-138942) Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> (cherry picked from commit 8ef7735c536e0ffe4a60224e59b7587288f53e9e)
* [3.13] gh-131189: Fix "msvcrt" import warning on Linux when "_ctypes" is not ↵Miss Islington (bot)2025-09-151-3/+4
| | | | | | | | | | | | | available. (GH-131201) (GH-138934) gh-131189: Fix "msvcrt" import warning on Linux when "_ctypes" is not available. (GH-131201) Fix "msvcrt" import warning on Linux when "_ctypes" is not available. On Linux, compiling without "libffi" causes a "No module named 'msvcrt'" warning when launching PyREPL. (cherry picked from commit f320c951c3220aa6727b581216463e8b3f8bcd6b) Co-authored-by: Dzmitry Plashchynski <plashchynski@gmail.com>
* [3.13] gh-134869: Fix Ctrl+C corrupts REPL autocomplete (GH-134929) (#137925)Miss Islington (bot)2025-08-181-0/+1
| | | | | | gh-134869: Fix Ctrl+C corrupts REPL autocomplete (GH-134929) (cherry picked from commit 8750e5ecfcfbc337efb511046d34f28b2d26bd68) Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
* [3.13] Bump mypy to 1.16.1 (GH-135720) (#135849)Hugo van Kemenade2025-06-241-3/+3
| | | | Co-authored-by: sobolevn <mail@sobolevn.me>
* [3.13] gh-134097: Print number of refs & blocks after each statement in new ↵Miss Islington (bot)2025-05-191-0/+9
| | | | | | | | REPL (gh-134136) (gh-134221) (cherry picked from commit c31547a5914db93b8b38c6a5261ef716255f3582) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.13] gh-132017: Handle SIGCONT in `pyrepl` (#132918) (#133470)Stan Ulbrych2025-05-051-0/+6
|
* [3.13] gh-131878: Fix input of unicode characters with two or more code ↵Łukasz Langa2025-05-052-9/+6
| | | | | | | | | points in new pyrepl on Windows (gh-131901) (gh-133468) (cherry picked from commit 0c5151bc81ec8e8588bef4389df12a9ab50e9fa0) Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com> Co-authored-by: Tomas R. <tomas.roun8@gmail.com> Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
* [3.13] gh-130804: Fix support of typing unicode chars in pyrepl (GH-130805) ↵Łukasz Langa2025-05-051-3/+9
| | | | | | | (GH-133462) (cherry picked from commit 7c98b0674daa3e4eb3e8f35afb61a0dba61d1780) Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
* [3.13] GH-132439: Fix REPL swallowing characters entered with AltGr on ↵Łukasz Langa2025-05-051-8/+12
| | | | | | | | cmd.exe (GH-132440) (GH-133460) (cherry picked from commit 07f416a3f063db6b91b8b99ff61a51b64b0503f1) Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* [3.13] gh-124096: Enable REPL virtual terminal support on Windows ↵Miss Islington (bot)2025-05-054-90/+213
| | | | | | | | | | | | | | | | | | | | (GH-124119) (GH-133457) To support virtual terminal mode in Windows PYREPL, we need a scanner to read over the supported escaped VT sequences. Windows REPL input was using virtual key mode, which does not support terminal escape sequences. This patch calls `SetConsoleMode` properly when initializing and send sequences to enable bracketed-paste modes to support verbatim copy-and-paste. (cherry picked from commit a65366ed879a3d9f27cbcc811ed2e05ad1a2af06) Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com> Signed-off-by: y5c4l3 <y5c4l3@proton.me> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Dustin L. Howett <dustin@howett.net> Co-authored-by: wheeheee <104880306+wheeheee@users.noreply.github.com>
* [3.13] gh-131878: Handle top level exceptions in new pyrepl and prevent of ↵Łukasz Langa2025-05-051-0/+5
| | | | | closing it (GH-131910) (GH-133445) Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
* [3.13] Bump mypy to 1.15 (GH-133405) (#133429)Miss Islington (bot)2025-05-051-1/+1
| | | | | | Bump mypy to 1.15 (GH-133405) (cherry picked from commit 8467026ed66ca3abefe3a13860d2633eae3d7164) Co-authored-by: sobolevn <mail@sobolevn.me>
* [3.13] gh-129098: avoid using content of `_pyrepl/__main__.py` when ↵Miss Islington (bot)2025-04-201-0/+4
| | | | | | | | reporting tracebacks (GH-130721) (#132755) gh-129098: avoid using content of `_pyrepl/__main__.py` when reporting tracebacks (GH-130721) (cherry picked from commit 492e3e6976d05b8de1892c37c900ada23eaeaf06) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.13] gh-128231: Use `runcode()` return value for failing early (GH-129488) ↵Miss Islington (bot)2025-03-281-1/+15
| | | | | | | | (#130513) gh-128231: Use `runcode()` return value for failing early (GH-129488) (cherry picked from commit 7ed3dc6392613832f66c63507385b1da109cbf21) Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
* [3.13] gh-131507: Refactor screen and cursor position calculations ↵Miss Islington (bot)2025-03-213-81/+96
| | | | | | | | | | (GH-131547) (GH-131557) gh-131507: Refactor screen and cursor position calculations (GH-131547) This is based off GH-131509. (cherry picked from commit 4cc82ffa377db5073fdc6f85c6f35f9c47397796) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.13] gh-131507: Clean up tests and type checking for `_pyrepl` (GH-131509) ↵Łukasz Langa2025-03-216-45/+36
| | | | | (GH-131546) (cherry picked from commit 5d8e981c8477ce483374b2fe6cd309a08c956299)
* [3.13] gh-117174: Add a new route in linecache to fetch interactive source ↵Miss Islington (bot)2025-03-102-2/+2
| | | | | | | | code (GH-117500) (#131060) gh-117174: Add a new route in linecache to fetch interactive source code (GH-117500) (cherry picked from commit a931a8b32415f311008dbb3f09079aae1e6d7a3d) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.13] gh-124927: Fix conversion issue between coordinates and position in ↵Miss Islington (bot)2025-03-101-1/+2
| | | | | | | | REPL (GH-125001) (#131061) gh-124927: Fix conversion issue between coordinates and position in REPL (GH-125001) (cherry picked from commit 6ab5c4aa05bf35832a3ccd1e71b28b8475fa30f4) Co-authored-by: FeH2 <i@feh2.im>
* [3.13] gh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings ↵Miss Islington (bot)2025-03-031-16/+26
| | | | | | | | | | | | | | | | | | (GH-128389) (GH-130500) gh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings (GH-128389) Fix `Lib/_pyrepl/windows_console.py` to support more keybindings, like the `Ctrl`+`←` and `Ctrl`+`→` word-skipping keybindings and those with meta (i.e. Alt), e.g. to `kill-word` or `backward-kill-word`. Specifics: if Ctrl is pressed, emit "ctrl left" and "ctrl right" instead of just "left" or "right," and if Meta/Alt is pressed, emit the special key code for meta before emitting the other key that was pressed. (cherry picked from commit 688f3a0d4b94874ff6d72af3baafd8bbf911153e) Co-authored-by: Paulie Peña <203125+paulie4@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
* [3.13] gh-127349: Add check for correct resizing in REPL (GH-127387) (#129485)donBarbos2025-02-041-2/+3
| | | (cherry picked from commit 510fefdc625dd2ed2b6b3975314a59e291b94ae8)
* [3.13] gh-118878: Pyrepl: show completions menu below the current line ↵Miss Islington (bot)2025-01-232-6/+11
| | | | | | | | | | (GH-118939) (#129161) gh-118878: Pyrepl: show completions menu below the current line (GH-118939) (cherry picked from commit 29caec62ee0650493c83c778ee2ea50b0501bc41) Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.13] gh-128330: Terminal control characters should be restored on repl ↵Miss Islington (bot)2025-01-231-1/+3
| | | | | | | | exit (GH-128331) (#129233) gh-128330: Terminal control characters should be restored on repl exit (GH-128331) (cherry picked from commit 0b15d9c0d2d30c7d3f17ebb90dd822ef32f977cc) Co-authored-by: Andy Fiddaman <andy@omnios.org>
* [3.13] gh-128636: Fix crash in PyREPL when `os.environ` is overwritten with ↵Miss Islington (bot)2025-01-221-5/+7
| | | | | | | | an invalid value (GH-128653) (#129186) gh-128636: Fix crash in PyREPL when `os.environ` is overwritten with an invalid value (GH-128653) (cherry picked from commit ba9a4b621577b92f36d88388cc9f791c2dc7d7ba) Co-authored-by: Tomas R <tomas.roun8@gmail.com>
* [3.13] gh-123024: Correctly prepare/restore around help and show-history ↵Miss Islington (bot)2025-01-216-57/+64
| | | | | | | | | | commands (GH-124485) (#129155) gh-123024: Correctly prepare/restore around help and show-history commands (GH-124485) (cherry picked from commit 5a9afe23620aadea30013076d64686be8bf66f7e) 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>
* [3.13] gh-126332: Fix pyrepl crash for double ctrl-z in line overflow ↵Miss Islington (bot)2025-01-211-1/+1
| | | | | | | | | | (GH-126650) (#129154) gh-126332: Fix pyrepl crash for double ctrl-z in line overflow (GH-126650) (cherry picked from commit d147e5e52cdb90496ae5fe85b3263cdfa9407a28) Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* [3.13] gh-122273: Support PyREPL history on Windows (#127141) (#127289)Victor Stinner2024-11-261-1/+3
| | | | | | gh-122273: Support PyREPL history on Windows (#127141) Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com> (cherry picked from commit 3c7a90a83146dc6e55f6f9ecd9af0bf9682f98a6)
* [3.13] gh-126456: Fix _pyrepl curses tigetstr() (GH-126472) (#126790)Miss Islington (bot)2024-11-131-2/+2
| | | | | | gh-126456: Fix _pyrepl curses tigetstr() (GH-126472) (cherry picked from commit b2bbdc56e3276f3b37ea5cf5f73f49c4cce6d9f6) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.13] gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new ↵Nice Zombies2024-10-141-2/+8
| | | | | | | | | | | | REPL (#124999) (#125475) gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL (#124999) Co-authored-by: Wulian <xiguawulian@gmail.com> Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 6a08a753b702ac63c9b6ac58dd204d1fe9662e9d)
* [3.13] Support the "pager" binary in _pyrepl (GH-122878) (#124242)Miss Islington (bot)2024-10-071-0/+2
| | | | | | | | | | | | | | | Support the "pager" binary in _pyrepl (GH-122878) Debian (and derivatives) provide a /usr/bin/pager binary, managed by the alternatives system, that always points to an available pager utility. Allow _pyrepl to use it, to follow system policy. This is a very trivial change, from a patch that Debian has been carrying since 2.7 era. Seems appropriate to upstream. https://bugs.debian.org/799555 (cherry picked from commit 426569eb8ca1edaa68026aa2bab6b8d1c9105f93) Co-authored-by: Stefano Rivera <stefano@rivera.za.net> Co-authored-by: T. Wouters <thomas@python.org>
* [3.13] gh-124628: Pyrepl inputs on Windows shouldn't always be blocking ↵Miss Islington (bot)2024-09-271-9/+21
| | | | | | | | reads (GH-124629) (#124638) gh-124628: Pyrepl inputs on Windows shouldn't always be blocking reads (GH-124629) (cherry picked from commit 83e5dc0f4d0d8d71288f162840b36f210fb03abf) Co-authored-by: Dino Viehland <dinoviehland@meta.com>
* [3.13] gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered ↵Miss Islington (bot)2024-09-261-5/+6
| | | | | | | | | 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 c1600c78e4565b6bb558ade451abe2648ba4dd0a) Co-authored-by: Emily Morehouse <emily@cuttlesoft.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.13] gh-124027: Support Del, PgUp, and PgDn on TERM=vt100 (GH-124028) ↵Miss Islington (bot)2024-09-132-0/+3
| | | | | | | | | | | | | | | | | | (#124029) gh-124027: Support Del, PgUp, and PgDn on TERM=vt100 (GH-124028) pyrepl: Support Del, PgUp, and PgDn on TERM=vt100 From Fedora's /etc/inputrc: "\e[5~": history-search-backward "\e[6~": history-search-forward "\e[3~": delete-char Fixes https://github.com/python/cpython/issues/124027 (cherry picked from commit f4e5643df64d0c2a009ed224560044b3409a47c0) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* [3.13] gh-120221: Support KeyboardInterrupt in asyncio REPL (GH-123795) ↵Miss Islington (bot)2024-09-064-17/+116
| | | | | | | | | | | | | | (#123799) This switches the main pyrepl event loop to always be non-blocking so that it can listen to incoming interruptions from other threads. This also resolves invalid display of exceptions from other threads (gh-123178). This also fixes freezes with pasting and an active input hook. (cherry picked from commit 033510e11dff742d9626b9fd895925ac77f566f1) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.13] gh-119310: Fix encoding when reading old history file (GH-121779) ↵Miss Islington (bot)2024-09-061-4/+8
| | | | | | | | (#123784) (cherry picked from commit e95984826eb3cdb3a3baedb2ccea35e11e9f8161) Co-authored-by: aorcajo <589252+aorcajo@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.13] gh-119034, REPL: Change page up/down keys to search in history ↵Miss Islington (bot)2024-09-063-4/+72
| | | | | | | | | | | (GH-123607) (GH-123773) Change <page up> and <page down> keys of the Python REPL to history search forward/backward. (cherry picked from commit 8311b11800509c975023e062e2c336f417c5e4c0) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.13] gh-111201: fix auto-indent in pyrepl for muliple pound comments ↵Miss Islington (bot)2024-09-061-1/+1
| | | | | | | (GH-123196) (GH-123764) (cherry picked from commit d683f49a7b0635a26150cfbb398a3d93b227a74e) Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
* [3.13] gh-123240: Raise input audit events in the new REPL (GH-123274) (#123737)Miss Islington (bot)2024-09-051-2/+6
| | | | | (cherry picked from commit aa1339aaaa6363c38186defaa079d069b4cb08b2) Co-authored-by: sobolevn <mail@sobolevn.me>
* [3.13] gh-123572: Fix key codes in VK_MAP in windows_console.py (GH-122692) ↵Miss Islington (bot)2024-09-031-4/+5
| | | | | | | | (#123632) gh-123572: Fix key codes in VK_MAP in windows_console.py (GH-122692) (cherry picked from commit 782217f28f0d67916fc3ff82b03b88573686c0e7) Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
* [3.13] gh-123177: Fix prompt for wrapped lines in pyrepl (GH-123324) (#123327)Miss Islington (bot)2024-08-261-1/+9
| | | | | | | | | | | | gh-123177: Fix prompt for wrapped lines in pyrepl (GH-123324) When display lines above the cursor come from the cache, the first line to not come from the cache may be a wrapped line, starting half way through a logical line in the buffer. Detect and handle this case to avoid accidentally drawing a stray prompt in the middle of a logical line. (cherry picked from commit 602fcf97df1665538d4e9841f9dc6bc33e38bece) Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
* [3.13] gh-123177: Deactivate line wrap for Apple Terminal via scape codes in ↵Miss Islington (bot)2024-08-251-0/+8
| | | | | | | | the new REPL (GH-123267) (#123322) gh-123177: Deactivate line wrap for Apple Terminal via scape codes in the new REPL (GH-123267) (cherry picked from commit fdb3f9b588f58f3cf95fe1dbf6e5b61ef525a351) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.13] gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() ↵Miss Islington (bot)2024-08-241-4/+3
| | | | | | | | | (GH-123281) (#123293) gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() (GH-123281) (cherry picked from commit ca18ff2a34435faa557f7f9d4d3a554dadb05e50) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* [3.13] gh-82378 fix sys.tracebacklimit in pyrepl, approach 2 (GH-123062) ↵CF Bolz-Tereick2024-08-231-2/+7
| | | | | | | (#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 63603bca35798c166e1b8e0be76aef69217f8b1b)
* [3.13] gh-122546: use same filename for different exceptions in new repl ↵Sergey B Kirpichev2024-08-221-1/+1
| | | | (GH-123217) (#123226)
* [3.13] gh-123149: Suppress verbose repr in new REPL (GH-123151) (#123157)Miss Islington (bot)2024-08-191-2/+2
| | | | | | gh-123149: Suppress verbose repr in new REPL (GH-123151) (cherry picked from commit 833c58b81ebec84dc24ef0507f8c75fe723d9f66) Co-authored-by: James <snoopjedi@gmail.com>
* [3.13] gh-121804: Always show error location for SyntaxError's in new repl ↵Sergey B Kirpichev2024-08-191-5/+5
| | | | | (GH-121886) (#123148) (cherry picked from commit 354d55eb1fa40f272419aa6459ee5d2c4804c8ea)
* [3.13] gh-119896: Fix CTRL-Z behavior in the new REPL on Windows (GH-122217) ↵Miss Islington (bot)2024-07-304-4/+14
| | | | | | | | (#122451) gh-119896: Fix CTRL-Z behavior in the new REPL on Windows (GH-122217) (cherry picked from commit d1a1bca1f0550a4715f1bf32b1586caa7bc4487b) Co-authored-by: Dino Viehland <dinoviehland@meta.com>
* [3.13] gh-121957: Emit audit events for `python -i` and `python -m asyncio` ↵Miss Islington (bot)2024-07-221-0/+2
| | | | | | | | | (GH-121958) (GH-122115) Relatedly, emit the `cpython.run_startup` event from the Python version of `PYTHONSTARTUP` handling. (cherry picked from commit dc93d1125f594ac7aece98558eaf33d09c348519) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.13] gh-120678: pyrepl: Include globals from modules passed with `-i` ↵Miss Islington (bot)2024-07-171-0/+3
| | | | | | | | (GH-120904) (#121916) (cherry picked from commit ac07451116d52dd6a5545d27b6a2e3737ed27cf0) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>