1
0
Fork 0
forked from github/pelican
pelican-theme/pelican/tools
Stuart Axon 012d034cba Check for 0 dates in pelican-import
Check for 0 dates.

For my own blog this means it doesn't break during import, but I don't know pelican well enough yet to say if this is correct or not.

Error that I was getting before applying this fix
```
Traceback (most recent call last):
  File "/mnt/data/home/stu/.virtualenvs/blog/bin/pelican-import", line 11, in <module>
    sys.exit(main())
  File "/mnt/data/home/stu/.virtualenvs/blog/local/lib/python2.7/site-packages/pelican/tools/pelican_import.py", line 896, in main
    attachments=attachments or None)
  File "/mnt/data/home/stu/.virtualenvs/blog/local/lib/python2.7/site-packages/pelican/tools/pelican_import.py", line 684, in fields2pelican
    kind, in_markup) in fields:
  File "/mnt/data/home/stu/.virtualenvs/blog/local/lib/python2.7/site-packages/pelican/tools/pelican_import.py", line 163, in wp2fields
    date_object = time.strptime(raw_date, '%Y-%m-%d %H:%M:%S')
  File "/usr/lib/python2.7/_strptime.py", line 478, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
    (data_string, format))
ValueError: time data u'0000-00-00 00:00:00' does not match format u'%Y-%m-%d %H:%M:%S'

```
2017-10-02 22:05:42 +01:00
..
templates Encourage use of https:// in SITEURL 2017-07-25 09:00:41 -07:00
__init__.py move tools in pelican.tools and add the pelican.tools package to setup.py 2012-03-16 18:53:08 +00:00
pelican_import.py Check for 0 dates in pelican-import 2017-10-02 22:05:42 +01:00
pelican_quickstart.py Encourage use of https:// in SITEURL 2017-07-25 09:00:41 -07:00
pelican_themes.py Correct new flake8 warnings 2017-01-24 09:12:16 +01:00