From 1fc17cc89809853492ceb0ae105679207bfcec25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 2 Jul 2024 11:33:00 +0200 Subject: [PATCH] Fix a bug that emptied the command history of the Python REPL (~/.python_history) --- ...1245-amend-d611c4c8e9-correct-import.patch | 37 +++++++++++++++++++ python3.13.spec | 9 ++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 00430-gh-121245-amend-d611c4c8e9-correct-import.patch diff --git a/00430-gh-121245-amend-d611c4c8e9-correct-import.patch b/00430-gh-121245-amend-d611c4c8e9-correct-import.patch new file mode 100644 index 0000000..d98110f --- /dev/null +++ b/00430-gh-121245-amend-d611c4c8e9-correct-import.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sergey B Kirpichev +Date: Tue, 2 Jul 2024 12:40:01 +0300 +Subject: [PATCH] 00430: gh-121245: Amend d611c4c8e9 (correct import) (#121255) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Miro Hrončok +--- + Lib/site.py | 3 +-- + .../Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst | 2 ++ + 2 files changed, 3 insertions(+), 2 deletions(-) + create mode 100644 Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst + +diff --git a/Lib/site.py b/Lib/site.py +index 8d193abfbb..7fff22328e 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -533,8 +533,7 @@ def register_readline(): + + def write_history(): + try: +- # _pyrepl.__main__ is executed as the __main__ module +- from __main__ import CAN_USE_PYREPL ++ from _pyrepl.main import CAN_USE_PYREPL + except ImportError: + CAN_USE_PYREPL = False + +diff --git a/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst b/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst +new file mode 100644 +index 0000000000..6e9dec2545 +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst +@@ -0,0 +1,2 @@ ++Fix a bug in the handling of the command history of the new :term:`REPL` that caused ++the history file to be wiped at REPL exit. diff --git a/python3.13.spec b/python3.13.spec index 127f3ec..e488c8a 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel b3 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -395,6 +395,10 @@ Patch251: 00251-change-user-install-location.patch # Another process might have already moved jit_stencils.h.new Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch +# 00430 # e6851cbe4b1043e8d99e3f3dfa9c9f286fe0d511 +# gh-121245: Amend d611c4c8e9 (correct import) (#121255) +Patch430: 00430-gh-121245-amend-d611c4c8e9-correct-import.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1709,6 +1713,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Jul 02 2024 Miro Hrončok - 3.13.0~b3-2 +- Fix a bug that emptied the command history of the Python REPL (~/.python_history) + * Fri Jun 28 2024 Karolina Surma - 3.13.0~b3-1 - Update to Python 3.13.0b3