From 7a5c16fdc04e79d0265d296624067fec16de5732 Mon Sep 17 00:00:00 2001 From: Marco Villegas Date: Sat, 29 Oct 2016 21:10:36 -0500 Subject: [PATCH] lwn_weekly: Prevents fail if article title is not defined. More resilient behavior if article title contains non-html-encoded characters. E.g. "" string in the title start is recognized by beatiful soup as html tag, but it is not, making the title a NoneType, and raising an exception on Article creation. This is actually a bug in the news page itself, but it anyways breaks the recipe; hence, adding here a fixed string if for any reason the article title end up with a NoneType. --- recipes/lwn_weekly.recipe | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/lwn_weekly.recipe b/recipes/lwn_weekly.recipe index 8c2c49a6cb..cca846b6ea 100644 --- a/recipes/lwn_weekly.recipe +++ b/recipes/lwn_weekly.recipe @@ -104,6 +104,8 @@ class WeeklyLWN(BasicNewsRecipe): elif 'SummaryHL' in curr.attrMap['class']: article_title = text + if not article_title: + article_title = _('Undefined article title') if subsection: section_title = "%s: %s" % (section, subsection)