fixing a crash when the cache is already a directory

This commit is contained in:
Lionel Dricot 2022-03-24 21:03:03 +01:00
parent 9a1d0fa255
commit c2879828d6
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,9 @@
# Offpunk History
## 1.2 - Marche 24th 2022
## 1.3 - Unreleased
- Fixed a crash when the cache is already a dir inside a dir.
## 1.2 - March 24th 2022
Very experimental release:
- Completely rewritten the HMTL, Gemtext and Gopher renderer. Tests needed!
- Removed dependancy to ansiwrap. We dont use it anymore (which is an important achievement)

View File

@ -1340,6 +1340,11 @@ class GeminiItem():
self.url += "/"
if self._cache_path.endswith("/"):
self._cache_path += index
#sometimes, the index itself is a dir
#like when folder/index.gmi?param has been created
#and we try to access folder
if os.path.isdir(self._cache_path):
self._cache_path += "/" + index
return self._cache_path
def get_capsule_title(self):