Commit graph

116 commits

Author SHA1 Message Date
Miss Islington (bot)
d729087c06
[3.14] gh-139246: zero-width word paste can be wrong in default repl (GH-139254) (GH-140796)
gh-139246: zero-width word paste can be wrong in default repl (GH-139254)

(cherry picked from commit 4e6dba0ef7)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: grayjk <grayjk@gmail.com>
2025-11-07 13:50:06 +01:00
Miss Islington (bot)
a7cfe862ba
[3.14] gh-131927: Do not emit PEP 765 warnings in ast.parse() (GH-139642) (GH-140786)
ast.parse() no longer emits syntax warnings for
return/break/continue in finally (see PEP-765) -- they are only
emitted during compilation.
(cherry picked from commit ad0a3f733b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-30 11:25:34 +00:00
Miss Islington (bot)
30ee67b2e4
[3.14] gh-137568: Ignore startup file in test_dumb_terminal_exits_cleanly (GH-140295) (GH-140628)
gh-137568: Ignore startup file in `test_dumb_terminal_exits_cleanly` (GH-140295)
(cherry picked from commit 06c779474c)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-10-26 15:15:49 +00:00
Miss Islington (bot)
af28efd8b4
[3.14] gh-139640: Fix swallowing syntax warnings in different modules (GH-139755) (GH-140117)
Some checks are pending
Tests / (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / Docs (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Change detection (push) Waiting to run
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
Revert GH-131993.

Fix swallowing some syntax warnings in different modules if they accidentally
have the same message and are emitted from the same line.

Fix duplicated warnings in the "finally" block.

(cherry picked from commit 279db6bede)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

* Update 2025-10-06-10-03-37.gh-issue-139640.gY5oTb.rst

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-14 15:56:01 +00:00
Miss Islington (bot)
8761d6e644
[3.14] gh-139391: properly handle signal.signal() in UnixConsole when called from a non-main thread (GH-139392) (#139858)
gh-139391: properly handle `signal.signal()` in `UnixConsole` when called from a non-main thread (GH-139392)
(cherry picked from commit b8c8b8f1d3)

Co-authored-by: yihong <zouzou0208@gmail.com>
2025-10-09 16:10:51 +00:00
Łukasz Langa
de87549eb8
[3.14] gh-133400: Fixed Ctrl+D (^D) behavior in :mod:_pyrepl module (GH-133883) (GH-139850)
(cherry picked from commit 81959a0364)

Co-authored-by: DeepWzh <wzh2012@outlook.com>
Co-authored-by: adam j hartz <adam@smatz.net>
2025-10-09 17:38:25 +02:00
Miss Islington (bot)
56072f9c05
[3.14] gh-139805: Bump test_repl_eio timeout for slow builtbots (GH-139807) (#139812)
Some checks are pending
Tests / (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
gh-139805: Bump `test_repl_eio` timeout for slow builtbots (GH-139807)
(cherry picked from commit e7e3d1d4a8)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-08 23:00:20 +00:00
Miss Islington (bot)
61d49a5d37
[3.14] gh-138239: Fix incorrect highlighting of "type" in type statements in the REPL (GH-138241) (GH-138937)
(cherry picked from commit 26cfb17942)

Co-authored-by: 00ll00 <40747228+00ll00@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-07 23:02:32 +02:00
Miss Islington (bot)
d912e9a852
[3.14] gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) (GH-138268) (GH-138943)
(cherry picked from commit 537133d2b6)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-10-07 21:24:01 +02:00
Miss Islington (bot)
52e88585b0
[3.14] gh-137179: Fix flaky test_history_survive_crash test (gh-137180) (gh-137216)
Kill the REPL subprocess once it prints the output from the command
immediately before the `time.sleep()`.
(cherry picked from commit 98d462cf4d)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-10-07 17:38:30 +00:00
Miss Islington (bot)
6e9845455e
[3.14] gh-135329: Use longer timeout in pyrepl test_repl_eio() (GH-139503) (#139506)
gh-135329: Use longer timeout in pyrepl test_repl_eio() (GH-139503)

Replace hardcoded 5 seconds with support.SHORT_TIMEOUT.

Fix the following error on slow CI such as GitHub Action UBSan:

test test_pyrepl failed -- Traceback (most recent call last):
  File "Lib/test/test_pyrepl/test_unix_console.py", line 362, in test_repl_eio
    _, err = proc.communicate(timeout=5)  # sleep for pty to settle
             ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "Lib/subprocess.py", line 1219, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 2126, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 1266, in _check_timeout
    raise TimeoutExpired(
    ...<2 lines>...
            stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[...]' timed out after 5 seconds
(cherry picked from commit c985822d86)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-07 19:38:12 +02:00
Miss Islington (bot)
7f293a615d
[3.14] gh-135329: prevent infinite traceback loop on Ctrl-C for strace (GH-138133) (#138973)
gh-135329: prevent infinite traceback loop on Ctrl-C  for strace (GH-138133)
(cherry picked from commit b9dbf6acb3)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <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>
2025-09-16 11:04:49 +00:00
Miss Islington (bot)
1c901860e6
[3.14] gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value for macOS (GH-138089) (#138938)
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-09-16 12:10:53 +03:00
Miss Islington (bot)
19a8670d7a
[3.14] gh-138801: re-enable pyrepl tests on Windows (GH-138802) (GH-138815)
gh-138801: re-enable `pyrepl` tests on Windows (GH-138802)
(cherry picked from commit 4f3cab96c1)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-09-15 16:42:36 +02:00
Miss Islington (bot)
655ad1c63e
[3.14] gh-138318, PyREPL: builtins should not be highlighted when used as attribute names (GH-138319) (#138654)
gh-138318, PyREPL: builtins should not be highlighted when used as attribute names (GH-138319)
(cherry picked from commit 7a3bca50e0)

Co-authored-by: yihong <zouzou0208@gmail.com>
2025-09-08 13:29:53 +00:00
Miss Islington (bot)
031645a884
[3.14] gh-135621: Remove dependency on curses from PyREPL (GH-136758) (GH-136915)
(cherry picked from commit 09dfb50f1b)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-07-21 13:02:41 +02:00
Miss Islington (bot)
2a9aeb0f57
[3.14] gh-136801: Fix PyREPL syntax highlightning on match cases after multi-line case (GH-136804) (GH-136813)
(cherry picked from commit 3a64844533)

Co-authored-by: Olga Matoula <olgamatoula@gmail.com>
2025-07-19 15:56:40 +02:00
Miss Islington (bot)
7775d93e2d
[3.14] gh-130999: Avoid exiting the new REPL when there are non-string candidates for suggestions (gh-131001) (gh-135019)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-06-02 16:58:03 +02:00
Miss Islington (bot)
7216f7b59c
[3.14] gh-69605: Disable PyREPL module autocomplete fallback on regular completion (gh-134181) (gh-134680)
(cherry picked from commit 0e3bc962c6)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
2025-05-25 23:33:02 +00:00
Miss Islington (bot)
6917fbf98f
[3.14] GH-130328: Fix WindowsConsoleGetEventTests after gh-133728 (gh-134660) (gh-134666)
(cherry picked from commit 1000283694)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-25 18:43:07 +00:00
Miss Islington (bot)
93aee568c0
[3.14] GH-130328: Speedup pasting in legacy console on Windows (gh-133728) (#134653)
(cherry picked from commit 91b48868a8)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-25 15:54:28 +02:00
Miss Islington (bot)
998991513b
[3.14] gh-127960 Fix the REPL to set the correct namespace by setting the correct __main__ module (gh-134275) (gh-134473)
The `__main__` module imported in the `_pyrepl` module points to the `_pyrepl` module itself when the interpreter was launched without `-m` option and didn't execute a module,
while it's an unexpected behavior that `__main__` can be `_pyrepl` and relative imports such as `from . import *` works based on the `_pyrepl` module.
(cherry picked from commit b1b8962443)

Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-22 03:33:35 +02:00
Miss Islington (bot)
69710b7087
[3.14] gh-134215: PyREPL: Do not show underscored modules by default during autocompletion (gh-134267) (gh-134388)
(cherry picked from commit a3a3cf6d15)

Co-authored-by: Kevin Hernández <kevin.hernandez@unet.edu.ve>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-20 23:12:02 +02:00
Miss Islington (bot)
7cbc3ea8fb
[3.14] gh-134235: Import Autocomplete for Builtin Modules (GH-134277) (#134285)
gh-134235: Import Autocomplete for Builtin Modules (GH-134277)

* added enhancement auto completing import with sys builtins

---------
(cherry picked from commit 8421b03b16)

Co-authored-by: Tom Wang <85062819+tommix626@users.noreply.github.com>
Co-authored-by: Hunter <hyoung3@gmail.com>
2025-05-19 21:46:50 +00:00
Miss Islington (bot)
7d995ea9fd
[3.14] gh-134214: Fix test case in pyrepl (gh-134223) (gh-134229)
(cherry picked from commit faebf87b37)

Co-authored-by: Jessica Temporal <jtemporal@users.noreply.github.com>
2025-05-19 14:51:46 +00:00
Miss Islington (bot)
a3c3d6f0ef
[3.14] gh-134158: Fix PyREPL coloring of double braces in f/t-strings (gh-134159) (#134227)
Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-19 17:39:05 +03:00
Miss Islington (bot)
182464eb9e
[3.14] gh-134097: Print number of refs & blocks after each statement in new REPL (gh-134136) (gh-134220)
(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:44 +02:00
Miss Islington (bot)
0c340d1083
[3.14] gh-133541: Handle SyntaxError raised by the tokenizer on user input (GH-133606) (#133709) 2025-05-08 20:41:01 +00:00
Miss Islington (bot)
2de8a8b7e9
[3.14] gh-133639: Fix test_auto_indent_default() doesn't run input_code (GH-133640) (#133646) 2025-05-08 08:50:57 +00:00
Łukasz Langa
f610bbdf74
gh-133346: Make theming support in _colorize extensible (GH-133347)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-05 23:45:25 +02:00
Chris Eibl
07f416a3f0
GH-132439: Fix REPL swallowing characters entered with AltGr on cmd.exe (GH-132440)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-05 18:45:45 +02:00
Sergey Miryanov
0c5151bc81
gh-131878: Fix input of unicode characters with two or more code points in new pyrepl on Windows (gh-131901)
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-05-05 18:25:00 +02:00
Łukasz Langa
fac41f56d4
gh-131507: Add support for syntax highlighting in PyREPL (GH-133247)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-02 20:22:31 +02:00
sobolevn
b739ec5ab7
gh-133054: Skip test_pyrepl tests when cannot use pyrepl is reported (#133055)
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-28 19:09:28 +03:00
Sergey B Kirpichev
276252565c
gh-127495: Append to history file after every statement in PyREPL (GH-132294) 2025-04-27 15:32:37 +02:00
Tomas R.
c3a7118065
gh-69605: Add module autocomplete to PyREPL (#129329) 2025-04-25 02:24:26 +01:00
Bénédikt Tran
492e3e6976
gh-129098: avoid using content of _pyrepl/__main__.py when reporting tracebacks (#130721) 2025-04-20 18:24:30 +01:00
Chris Eibl
815061cbab
speedup test_pyrepl (#132688)
speedup test_unix_console.py and test_windows_console.py
2025-04-19 02:12:40 +01:00
Tomas R.
3d08c8ad20
gh-131927: Prevent emitting optimizer warnings twice in the REPL (#131993) 2025-04-12 11:34:36 +01:00
Bartosz Sławecki
a6cf8275f8
gh-117174: Adapt test_multiple_statements_fail_early to new REPL behavior (follow-up gh-131065) (#131836)
Adapt test to new REPL behavior (follow-up gh-117174)
2025-03-28 15:09:31 +01:00
Łukasz Langa
5d8e981c84
gh-131507: Clean up tests and type checking for _pyrepl (#131509) 2025-03-21 15:48:10 +01:00
R. David Murray
a09c2b2ba6
Fix test_pyrepl.TestDumbTerminal if PYTHON_BASIC_REPL set. (#131332)
Most of the tests that care already adjust PYTHON_BASIC_REPL as needed,
but this one doesn't, and it fails if the developer has the variable set.
2025-03-17 18:56:21 +01:00
Victor Stinner
b2ca26875a
gh-131152: Remove unused imports from tests (part 2) (#131154) 2025-03-13 10:57:40 +01:00
Sergey Miryanov
7c98b0674d
gh-130804: Fix support of typing unicode chars in pyrepl (#130805) 2025-03-10 22:13:50 +00:00
FeH2
6ab5c4aa05
gh-124927: Fix conversion issue between coordinates and position in REPL (#125001) 2025-03-10 21:54:49 +00:00
Bartosz Sławecki
7ed3dc6392
gh-128231: Use runcode() return value for failing early (GH-129488) 2025-02-24 15:50:13 +01:00
Y5
a65366ed87
gh-124096: Enable REPL virtual terminal support on Windows (#124119)
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.

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>
2025-02-23 20:30:33 +01:00
Pieter Eendebak
0c4248f88e
gh-126332: Add tests for _pyrepl.utils (#129325) 2025-02-21 16:10:13 +00:00
AN Long
798f8d3ea9
Replace non-breaking spaces with normal spaces (#130116)
Using normal spaces in place of non-breaking spaces.
2025-02-16 09:33:14 +08:00
donBarbos
510fefdc62
gh-127349: Add check for correct resizing in REPL (#127387) 2025-01-30 19:34:09 +00:00