Mercurial > piecrust2
changeset 933:7e7fc7926307
sources: File-system sources accept all `open` arguments.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 04 Oct 2017 09:11:17 -0700 |
parents | 0eca08213354 |
children | 98430e7143d2 |
files | piecrust/sources/fs.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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)