https://github.com/python/cpython/commit/52ccf264dfc29e28c24b2445c69d63c99989b3c7
commit: 52ccf264dfc29e28c24b2445c69d63c99989b3c7
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: pablogsal <[email protected]>
date: 2025-01-23T17:55:28Z
summary:

[3.13] gh-128330: Terminal control characters should be restored on repl 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 <[email protected]>

files:
A 
Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst
M Lib/_pyrepl/fancy_termios.py

diff --git a/Lib/_pyrepl/fancy_termios.py b/Lib/_pyrepl/fancy_termios.py
index 5b85cb0f52521f..0468b9a2670267 100644
--- a/Lib/_pyrepl/fancy_termios.py
+++ b/Lib/_pyrepl/fancy_termios.py
@@ -40,7 +40,9 @@ def as_list(self):
             self.lflag,
             self.ispeed,
             self.ospeed,
-            self.cc,
+            # Always return a copy of the control characters list to ensure
+            # there are not any additional references to self.cc
+            self.cc[:],
         ]
 
     def copy(self):
diff --git 
a/Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst
 
b/Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst
new file mode 100644
index 00000000000000..8fe628d18f4bd4
--- /dev/null
+++ 
b/Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst
@@ -0,0 +1 @@
+Restore terminal control characters on REPL exit.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to