hyde/hyde — Issue #142: TypeError: can't compare offset-naive and offset-aware datetimes
Author: andreas-h
Created: 2012-01-11 20:28:59+00:00
State: open

Hi,

I'm running into strange problems with the `created:` metadata. I started describing the problem [here](https://github.com/hyde/hyde/pull/137). I'm using the `hyde.ext.plugins.git.GitDatesPlugin`, Hyde 0.8.4, Python 2.7.2.

In my `site.yaml`, I have set `created: git`. If that's the only place where I set the `created` metadata, everything works fine, with the datestamp coming from git. However, there's cases where I want to manually set the `created` to some other timestamp. But as soon as I enter the line `created: !!timestamp '2012-01-05 17:20:20 +01:00'` into one of my source documents, the site generation fails:

```
Traceback (most recent call last):
File "/home/andreas/.virtualenvs/hyde/bin/hyde", line 9, in
load_entry_point('hyde==0.8.4', 'console_scripts', 'hyde')()
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/hyde/main.py", line 10, in main
Engine().run()
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/hyde/engine.py", line 39, in run
super(Engine, self).run(args)
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/commando.py", line 198, in run
args.run(self, args)
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/hyde/engine.py", line 118, in gen
gen.generate_all(incremental=incremental)
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/hyde/generator.py", line 202, in generate_all
self.events.begin_site()
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/hyde/plugin.py", line 44, in __call_plugins__
res = function(*args)
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/hyde/ext/plugins/sorter.py", line 128, in begin_site
for prev, next in pairwalk(walker()):
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/hyde/util.py", line 98, in method__
return method_(*args, **kwargs)
File "/home/andreas/.virtualenvs/hyde/lib/python2.7/site-packages/hyde/ext/plugins/sorter.py", line 69, in sort_method
reverse=reverse)
TypeError: can't compare offset-naive and offset-aware datetimes
```

This also happens when I change the line to `created: !!timestamp '2012-01-05 17:20:20'`.

I'm at a loss here -- what's going wrong? Any help is greatly appreciated!