[elbe-devel] [PATCH 6/9] elbepack: filesystem: add opener support to open()
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Mon Jul 29 10:46:33 CEST 2024
Mirror the stdlib open() function.
This argument is useful to specify file permissions.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/filesystem.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/elbepack/filesystem.py b/elbepack/filesystem.py
index c63445c2ec85..e7b487abf78b 100644
--- a/elbepack/filesystem.py
+++ b/elbepack/filesystem.py
@@ -70,7 +70,7 @@ class Filesystem:
path = path[1:]
return os.path.join(self.path, path)
- def open(self, path, mode='r'):
+ def open(self, path, mode='r', *, opener=None):
"""
>>> this.open("open") # doctest: +ELLIPSIS
Traceback (most recent call last):
@@ -82,7 +82,7 @@ class Filesystem:
>>> _.close()
"""
- return open(self.fname(path), mode)
+ return open(self.fname(path), mode, opener=opener)
def isdir(self, path):
"""
--
2.45.2
More information about the elbe-devel
mailing list