Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue when dateparser.parse returns None #216

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions memorious/logic/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ def last_modified(self):
if last_modified_header is not None:
# Tue, 15 Nov 1994 12:45:26 GMT
last_modified = parse_date(last_modified_header)
if last_modified is None:
return None

if last_modified < now + timedelta(seconds=30):
return last_modified.strftime("%Y-%m-%dT%H:%M:%S%z")
return None
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="memorious",
version="2.5.0",
version="2.5.1",
description="A minimalistic, recursive web crawling library for Python.",
long_description="",
classifiers=[
Expand Down