solving a crash when directly entering an unknown gopher address while offline

This commit is contained in:
Lionel Dricot 2022-03-27 16:24:19 +02:00
parent 9a3013fa5c
commit 040f077836
2 changed files with 6 additions and 3 deletions

View File

@ -5,6 +5,7 @@
- Default width set to 80 as many gopherhole and gemini capsule have it hardcoded
- Streaming URL without valid content-length are now closed after 5Mo of download (thanks to Eoin Carney for reporting the issue)
- Fixed a crash when the cache is already a dir inside a dir.
- Fixed a crash when manually entering an unknown gopher URL while offline
## 1.2 - March 24th 2022
Very experimental release:

View File

@ -672,7 +672,7 @@ class GemtextRenderer(AbstractRenderer):
def get_title(self):
if self.title:
return self.title
else:
elif self.body:
lines = self.body.splitlines()
for line in lines:
if line.startswith("#"):
@ -689,6 +689,8 @@ class GemtextRenderer(AbstractRenderer):
else:
self.title = "Empty Page"
return self.title
else:
return "Unknown Gopher Page"
#render_gemtext
def render(self,gemtext, width=None,mode=None):
@ -1471,8 +1473,8 @@ class GeminiItem():
f.close()
return body
else:
print("ERROR: NOCACHE for %s" %self._cache_path)
return error
#print("ERROR: NOCACHE for %s" %self._cache_path)
return None
# This method is used to load once the list of links in a gi
# Links can be followed, after a space, by a description/title