# HG changeset patch # User Ludovic Chabant # Date 1507133477 25200 # Node ID 7e7fc7926307161e144bc88393cfe08c423580d5 # Parent 0eca082133541c54edf8b77d988b4605bfd03e31 sources: File-system sources accept all `open` arguments. diff -r 0eca08213354 -r 7e7fc7926307 piecrust/sources/fs.py --- a/piecrust/sources/fs.py Wed Oct 04 09:10:41 2017 -0700 +++ b/piecrust/sources/fs.py Wed Oct 04 09:11:17 2017 -0700 @@ -48,7 +48,7 @@ self.fs_endpoint_path) return True - def openItem(self, item, mode='r', encoding=None): + def openItem(self, item, mode='r', **kwargs): for m in 'wxa+': if m in mode: # If opening the file for writing, let's make sure the @@ -57,7 +57,7 @@ if not os.path.exists(dirname): os.makedirs(dirname, 0o755) break - return open(item.spec, mode, encoding=encoding) + return open(item.spec, mode, **kwargs) def getItemMtime(self, item): return os.path.getmtime(item.spec)