From 0f2011d3028db878460c281ae7010a47ebea10b2 Mon Sep 17 00:00:00 2001 From: Noorhteen Raja NJ Date: Wed, 26 Jun 2024 13:19:26 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20Fixed=20``history=20gc``=20invocation=20?= =?UTF-8?q?failing=20when=20``sqlite``=20history=20=E2=80=A6=20(#5540)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …backend is used. ## For community ⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍 comment** --- news/sqlite-history-gc.rst | 23 +++++++++++++++++++++++ xonsh/history/base.py | 2 +- xonsh/history/json.py | 2 +- xonsh/history/sqlite.py | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 news/sqlite-history-gc.rst diff --git a/news/sqlite-history-gc.rst b/news/sqlite-history-gc.rst new file mode 100644 index 0000000000..f722528bb8 --- /dev/null +++ b/news/sqlite-history-gc.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fixed ``history gc`` invocation failing when ``sqlite`` history backend is used. + +**Security:** + +* diff --git a/xonsh/history/base.py b/xonsh/history/base.py index 6000b6c275..97128771ad 100644 --- a/xonsh/history/base.py +++ b/xonsh/history/base.py @@ -156,7 +156,7 @@ def info(self): """ raise NotImplementedError - def run_gc(self, size=None, blocking=True): + def run_gc(self, size=None, blocking=True, **_): """Run the garbage collector. Parameters diff --git a/xonsh/history/json.py b/xonsh/history/json.py index a9f2f7c5e2..b72f3de40b 100644 --- a/xonsh/history/json.py +++ b/xonsh/history/json.py @@ -585,7 +585,7 @@ def info(self): data["gc_last_size"] = f"{(self.hist_size, self.hist_units)}" return data - def run_gc(self, size=None, blocking=True, force=False): + def run_gc(self, size=None, blocking=True, force=False, **_): self.gc = JsonHistoryGC(wait_for_shell=False, size=size, force=force) if blocking: while self.gc.is_alive(): # while waiting for gc. diff --git a/xonsh/history/sqlite.py b/xonsh/history/sqlite.py index e17431b0ef..09e35c5729 100644 --- a/xonsh/history/sqlite.py +++ b/xonsh/history/sqlite.py @@ -382,7 +382,7 @@ def pull(self, show_commands=False): self.last_pull_time = time.time() return cnt - def run_gc(self, size=None, blocking=True): + def run_gc(self, size=None, blocking=True, **_): self.gc = SqliteHistoryGC(wait_for_shell=False, size=size) if blocking: while self.gc.is_alive():