# HG changeset patch # User Ludovic Chabant # Date 1424404509 28800 # Node ID ba857c693c72bf4ff80d0cfbb2e783c23ebb722d # Parent 26e59f8375580dae48b83cccb4339781b7914c97 sources: Fix a bug where the `posts` source wasn't correctly parsing URLs. Don't crash when a component is missing from the URL and we have to recapture. diff -r 26e59f837558 -r ba857c693c72 piecrust/sources/posts.py --- a/piecrust/sources/posts.py Thu Feb 19 08:09:17 2015 -0800 +++ b/piecrust/sources/posts.py Thu Feb 19 19:55:09 2015 -0800 @@ -53,9 +53,9 @@ ext = self.default_auto_format replacements = { - 'year': '%04d' % year, - 'month': '%02d' % month, - 'day': '%02d' % day, + 'year': '%04d' % year if year is not None else None, + 'month': '%02d' % month if month is not None else None, + 'day': '%02d' % day if day is not None else None, 'slug': slug, 'ext': ext }