Closed zackw closed 9 years ago
Hm, so, fixed in the development version? I'll test that.
Where is this?
It's broken with WITH_FUTURE_DATES = True with Pelican installed via pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican"
@eflee broken how?
This is still an issue for me in pelican 3.5.0. This issue doesn't occur in pelican 3.4.0. Here is some proof:
pelican --version
3.5.0
Same error whether WITH_FUTURE_DATES is True or False:
(env)myuser@myhost ~/h/myblog> make html;
find /home/myuser/hg/myblog/output -mindepth 1 -delete
pelican /home/myuser/hg/myblog/content -o /home/myuser/hg/myblog/output -s /home/myuser/hg/myblog/pelicanconf.py
CRITICAL: can't subtract offset-naive and offset-aware datetimes
Makefile:46: recipe for target '/home/myuser/hg/myblog/output/index.html' failed
make: *** [/home/myuser/hg/myblog/output/index.html] Error 1
pelican --version
3.4.0
(env)myuser@myhost ~/h/myblog> make html;
find /home/myuser/hg/myblog/output -mindepth 1 -delete
pelican /home/myuser/hg/myblog/content -o /home/myuser/hg/myblog/output -s /home/myuser/hg/myblog/pelicanconf.py
Done: Processed 32 article(s), 0 draft(s) and 0 page(s) in 0.48 seconds.
Done
@russellballestrini: Perhaps you should try the current master
branch?
@justinmayer ok, will test.
Please ignore my comments above, not directly related to this error
install latest master from github:
pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican"
check version:
pelican --version
3.5.0
CRITICAL: can't subtract offset-naive and offset-aware datetimes
On further investigation I deduced that it is my custom theme that is attempting to use the date object that is causing the exception!
At some point Pelican started using timezone aware datetime objects and my code was trying to perform math on them without timezones. The quick hack work around to fix my theme was to strip the timezone data from the datetime object, like so _(articledate.html):
<span title="{{ article.date.isoformat() }}" class="published">
{{ article.date.replace(tzinfo=None) | ago(1,'Posted {} ago') }}
</span>
This should be addressed in 3.6, which was just released.
Ran into this error with pelican 3.6.0 and Python 3.4.
Fixed it by updating my pelicans-plugins repo with:
git pull --recurse-submodules
git submodule update --recursive
I tried to set
WITH_FUTURE_DATES = False
for a site where I want to write posts in advance and have them automatically appear (via a cron job) when their date comes around. This mode appears to have been broken for quite some time: I get this error message for every single post:and the generated site is empty.
This is with Python 2.7, fwiw.