Closed arcombe012 closed 1 year ago
in extractors.py the function try_date_expr() does not check that the string argument is of the right type and raises an exception if it is not.
extractors.py
try_date_expr()
To reproduce: when processing a meta node of the form
<meta itemprop="dateCreated" datetime="">
in examine_header(), the line
examine_header()
attempt = tryfunc(elem.get("datetime") or elem.get("content"))
calls try_date_expr() with string=None which raises AttributeError: 'NoneType' object has no attribute 'strip'
string=None
AttributeError: 'NoneType' object has no attribute 'strip'
Suggestion: add in try_date_expr()
if not string: return None
Hi @arcombe012, it makes perfect sense, feel free to write a pull request if you wish to.
in
extractors.py
the functiontry_date_expr()
does not check that the string argument is of the right type and raises an exception if it is not.To reproduce: when processing a meta node of the form
in
examine_header()
, the linecalls
try_date_expr()
withstring=None
which raisesAttributeError: 'NoneType' object has no attribute 'strip'
Suggestion: add in
try_date_expr()