Mercurial > piecrust2
diff piecrust/baking/baker.py @ 7:343d08ef5668
More PieCrust 3 fixes, and a couple of miscellaneous bug fixes.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 16 Aug 2014 15:07:22 -0700 |
parents | f5ca5c5bed85 |
children | 617191dec18e |
line wrap: on
line diff
--- a/piecrust/baking/baker.py Sat Aug 16 08:15:30 2014 -0700 +++ b/piecrust/baking/baker.py Sat Aug 16 15:07:22 2014 -0700 @@ -192,7 +192,7 @@ if not os.path.isdir(out_dir): os.makedirs(out_dir, 0o755) - with codecs.open(out_path, 'w', 'utf-8') as fp: + with codecs.open(out_path, 'w', 'utf8') as fp: fp.write(rp.content) return ctx, rp @@ -235,7 +235,8 @@ # Load/create the bake record. record = TransitionalBakeRecord() record_cache = self.app.cache.getCache('bake_r') - record_name = hashlib.md5(self.out_dir).hexdigest() + '.record' + record_name = (hashlib.md5(self.out_dir.encode('utf8')).hexdigest() + + '.record') if not self.force and record_cache.has(record_name): t = time.clock() record.loadPrevious(record_cache.getCachePath(record_name))