1
0
Fork 0
forked from github/pelican
pelican-theme/pelican
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
..
tests Regenerate tests' output 2017-08-06 13:55:34 +02:00
themes Remove Internet Explorer script, as it wasn't being used: 404 HTTP error 2017-07-30 17:49:43 +02:00
tools Check for 0 dates in pelican-import 2017-10-02 22:05:42 +01:00
__init__.py Fix more python 3.6 regex DeprecationWarning's 2017-03-29 10:19:47 +02:00
cache.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
contents.py Consolidate validation of content (#2128) 2017-07-24 10:01:14 -07:00
generators.py Consolidate validation of content (#2128) 2017-07-24 10:01:14 -07:00
log.py Correct new flake8 warnings 2017-01-24 09:12:16 +01:00
paginator.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
readers.py Ability to override docutils HTML writer/translator. 2017-06-30 22:59:42 +02:00
rstdirectives.py Fix warnings originating from bad regexes 2017-03-27 16:09:08 +02:00
server.py prevent server from dying when query strings present 2016-12-10 10:05:50 -08:00
settings.py Consolidate validation of content (#2128) 2017-07-24 10:01:14 -07:00
signals.py Add new signal: feed_generated 2017-01-16 11:33:13 +01:00
urlwrappers.py Add AUTHOR_SUBSTITUTIONS 2016-04-01 23:01:57 +03:00
utils.py Fix warnings originating from bad regexes 2017-03-27 16:09:08 +02:00
writers.py Merge pull request #2085 from Scheirle/feed_signal 2017-03-19 15:04:07 -04:00