summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_zipfile.py6
-rw-r--r--Lib/zipfile.py4
2 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index b3c2421..7c09e2f 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -2966,6 +2966,12 @@ class TestPath(unittest.TestCase):
assert e.read_text() == "content of e"
@pass_alpharep
+ def test_joinpath_multiple(self, alpharep):
+ root = zipfile.Path(alpharep)
+ e = root.joinpath("b", "d", "e.txt")
+ assert e.read_text() == "content of e"
+
+ @pass_alpharep
def test_traverse_truediv(self, alpharep):
root = zipfile.Path(alpharep)
a = root / "a.txt"
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index e1a50a3..0eed4ce 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -2379,8 +2379,8 @@ class Path:
def __repr__(self):
return self.__repr.format(self=self)
- def joinpath(self, add):
- next = posixpath.join(self.at, add)
+ def joinpath(self, *other):
+ next = posixpath.join(self.at, *other)
return self._next(self.root.resolve_dir(next))
__truediv__ = joinpath