+3
-3
src/pyzotero/zotero.py
+3
-3
src/pyzotero/zotero.py
···
796
796
"""Dump a file attachment to disk, with optional filename and path"""
797
797
if not filename:
798
798
filename = self.item(itemkey)["data"]["filename"]
799
-
pth = Path(path) / filename if path else filename
799
+
pth = Path(path) / filename if path else Path(filename)
800
800
file = self.file(itemkey)
801
801
if self.snapshot:
802
802
self.snapshot = False
803
-
pth += ".zip"
804
-
with Path(pth).open("wb") as f:
803
+
pth = pth.parent / (pth.name + ".zip")
804
+
with pth.open("wb") as f:
805
805
f.write(file)
806
806
807
807
@retrieve