diff piecrust/sources/fs.py @ 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 d9059257743c
children 84fc72a17f7a
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)