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 up the datetime comparison error caused by timezone. #1525

Merged
merged 1 commit into from Dec 11, 2014

Conversation

tonyseek
Copy link
Contributor

If the article's date is timezone-carried, "now" should be too. Or can't compare offset-naive and offset-aware datetimes will be raised.

"can't compare offset-naive and offset-aware datetimes".
@justinmayer
Copy link
Member

@ametaireau / @kylef / @smartass101 / @avaris: Any input or comment on this pull request?

@smartass101
Copy link
Contributor

Looks fine to me.

@justinmayer justinmayer added this to the 3.6 milestone Dec 11, 2014
@justinmayer
Copy link
Member

Thanks for the fix, Jiangge!

justinmayer added a commit that referenced this pull request Dec 11, 2014
Fix a datetime comparison error related to time zones
@justinmayer justinmayer merged commit 7e96106 into getpelican:master Dec 11, 2014
@tonyseek tonyseek deleted the fixup-timezone-comparison branch August 11, 2015 07:17
@sassman
Copy link

sassman commented Sep 22, 2018

seems that this issue is also on the sitemap generation:

File "/Users/d34dl0ck/workspaces/web/www.d34dl0ck.me/devblog/pelican-plugins/sitemap/sitemap.py", line 188, in generate_output
    self.set_url_wrappers_modification_date(self.context['categories'])
  File "/Users/d34dl0ck/workspaces/web/www.d34dl0ck.me/devblog/pelican-plugins/sitemap/sitemap.py", line 171, in set_url_wrappers_modification_date
    lastmod = max(lastmod, article.date)
TypeError: can't compare offset-naive and offset-aware datetimes
make: *** [html] Error 1

using pelican version 3.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants