From 6ce35be87f8cc887c73dda6271258c9ea96926f6d096dae4f0e0fd38778b0158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 14 Jul 2020 12:39:50 +0000 Subject: [PATCH] Accepting request 820864 from home:alarrosa:branches:devel:languages:python:Factory - Import readline in the save_history handler. Otherwise the call to readline.write_history_file doesn't work (the readline import at the beginning of the file is already removed) and is silently ignored by the exception catcher. OBS-URL: https://build.opensuse.org/request/show/820864 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/shared-python-startup?expand=0&rev=11 --- pythonstart | 2 ++ shared-python-startup.changes | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/pythonstart b/pythonstart index 436f379..b6d8a4f 100644 --- a/pythonstart +++ b/pythonstart @@ -15,10 +15,12 @@ historyPath = os.path.expanduser("~/.pyhistory%s" % ver) # handler for saving history def save_history(historyPath=historyPath): + import readline try: readline.write_history_file(historyPath) except: pass + del readline # read history, if it exists diff --git a/shared-python-startup.changes b/shared-python-startup.changes index 6bf73ff..e73bc7c 100644 --- a/shared-python-startup.changes +++ b/shared-python-startup.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jul 14 11:03:14 UTC 2020 - Antonio Larrosa + +- Import readline in the save_history handler. Otherwise the call + to readline.write_history_file doesn't work (the readline import + at the beginning of the file is already removed) and is silently + ignored by the exception catcher. + ------------------------------------------------------------------- Mon Apr 27 13:18:52 UTC 2020 - Matej Cepl