# HG changeset patch # User Ludovic Chabant # Date 1410676307 25200 # Node ID d74ae33832ae4ca0d17b56ea862381517875ab0a # Parent 69d5eecfa44982c4fbc9b563e45f25bbc1437356 Fix a bug with the posts source incorrectly escaping regex characters. diff -r 69d5eecfa449 -r d74ae33832ae piecrust/sources/posts.py --- a/piecrust/sources/posts.py Sat Sep 13 23:31:21 2014 -0700 +++ b/piecrust/sources/posts.py Sat Sep 13 23:31:47 2014 -0700 @@ -93,7 +93,8 @@ 'slug': '(?P.*)', 'ext': '(?P.*)' } - pattern = self.path_format % regex_repl + '$' + path_format_re = re.sub(r'([\-\.])', r'\\\1', self.path_format) + pattern = path_format_re % regex_repl + '$' m = re.search(pattern, path.replace('\\', '/')) if not m: raise Exception("Expected to be able to match path with path "