fixes a crash when parsing invalid RSS dates

This commit is contained in:
Ploum 2023-11-03 23:01:46 +01:00
parent bf17b21b30
commit 856b89ff45
2 changed files with 7 additions and 2 deletions

View File

@ -17,6 +17,7 @@ Changes since beta1
- fixes a bug in HTML renderer where some hX element were not closed properly
- fixes input in Gemini while online
- fixes a crash with invalid URL
- fixes a crash while parsing invalid dates in RSS
- fixes hang/crash when meeting the ";" itemtype in gopher
- attempt at hiding XMLparsedAsHTMLWarning from BS4 library
- chafa now used by default everywhere if version > 1.10

View File

@ -903,8 +903,12 @@ class FeedRenderer(GemtextRenderer):
else:
line = "* "
if "published" in i:
pub_date = time.strftime("%Y-%m-%d",i.published_parsed)
line += pub_date + " : "
#sometimes fails so protect it
try:
pub_date = time.strftime("%Y-%m-%d",i.published_parsed)
line += pub_date + " : "
except:
pass
if "title" in i:
line += "%s" %(i.title)
if "author" in i: