From 6d87b2f4bc0b98606fedff150cd9977e92003ff8 Mon Sep 17 00:00:00 2001 From: Lionel Dricot Date: Tue, 22 Feb 2022 13:24:36 +0100 Subject: [PATCH] solve a crash when calling less after a mailto link --- CHANGELOG | 3 +++ offpunk.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 92bc9f7..e370177 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Offpunk History +## 0.5 - Unreleased +- Avoid deprecated SSL methods (thanks Phoebos for the report) + ## 0.4 - Feb 21st 2022 UPGRADE: Users who subscribed to pages before 0.4 should run once the command "list subscribe subscribed". Without that, the subscribed list will be seen as a normal list by sync. - New list command : "list freeze" and "list suscribe" diff --git a/offpunk.py b/offpunk.py index 979eb5d..b3b9a4c 100755 --- a/offpunk.py +++ b/offpunk.py @@ -1236,7 +1236,9 @@ class GeminiItem(): return self.mime elif self.is_cache_valid(): path = self.get_cache_path() - if os.path.isdir(path): + if self.scheme == "mailto": + mime = "mailto" + elif os.path.isdir(path): mime = "Local Folder" elif path.endswith(".gmi"): mime = "text/gemini" @@ -2760,7 +2762,7 @@ Use "less full" to see a complete html page instead of the article view. (the "full" argument has no effect on Gemtext content but doesn’t restore position).""" if self.gi and args and args[0] == "full": self._go_to_gi(self.gi,readable=False) - elif self.gi.is_cache_valid(): + elif self.gi.is_cache_valid() and self.gi.scheme not in ["mailto"]: less_cmd(self._get_active_tmpfile(),histfile=self.less_histfile) else: self.do_go(self.gi.url)