···800800 if self.snapshot:
801801 self.snapshot = False
802802 pth += ".zip"
803803- with Path.open(pth, "wb") as f:
803803+ with Path(pth).open("wb") as f:
804804 f.write(file)
805805806806 @retrieve
···18541854 if Path(str(self.basedir.joinpath(templt["filename"]))).is_file():
18551855 try:
18561856 # if it is a file, try to open it, and catch the error
18571857- with Path.open(str(self.basedir.joinpath(templt["filename"]))):
18571857+ with Path(str(self.basedir.joinpath(templt["filename"]))).open():
18581858 pass
18591859 except OSError:
18601860 msg = f"The file at {self.basedir.joinpath(templt['filename'])!s} couldn't be opened or found."
···19141914 """Step 1: get upload authorisation for a file"""
19151915 mtypes = mimetypes.guess_type(attachment)
19161916 digest = hashlib.md5() # noqa: S324
19171917- with Path.open(attachment, "rb") as att:
19171917+ with Path(attachment).open("rb") as att:
19181918 for chunk in iter(lambda: att.read(8192), b""):
19191919 digest.update(chunk)
19201920 auth_headers = {"Content-Type": "application/x-www-form-urlencoded"}
···19611961 upload_list = [("key", upload_dict.pop("key"))]
19621962 for key, value in upload_dict.items():
19631963 upload_list.append((key, value))
19641964- upload_list.append(("file", Path.open(attachment, "rb").read()))
19641964+ upload_list.append(("file", Path(attachment).open("rb").read()))
19651965 upload_pairs = tuple(upload_list)
19661966 try:
19671967 self.zinstance._check_backoff()