From 44e4be4e78c67662eae44404d97472f1d703db1c Mon Sep 17 00:00:00 2001 From: themanyfaceddemon Date: Tue, 13 Aug 2024 00:06:06 +0300 Subject: [PATCH] hot fix bugs --- DMBotNetwork/client.py | 6 ++++-- DMBotNetwork/server.py | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DMBotNetwork/client.py b/DMBotNetwork/client.py index d04a4eb..601be58 100644 --- a/DMBotNetwork/client.py +++ b/DMBotNetwork/client.py @@ -260,8 +260,10 @@ async def _download_file(self, server_data: dict) -> None: if not file_name: return - file_path: Path = self._server_file_path / self._cur_server_name / file_name - file_path.mkdir(parents=True, exist_ok=True) + dir_path = self._server_file_path / self._cur_server_name + dir_path.mkdir(parents=True, exist_ok=True) + file_path = dir_path / file_name + with open(file_path, "wb") as file: received_size = 0 diff --git a/DMBotNetwork/server.py b/DMBotNetwork/server.py index d022828..14d6871 100644 --- a/DMBotNetwork/server.py +++ b/DMBotNetwork/server.py @@ -400,8 +400,7 @@ async def send_data_login(self, login: str, data: Any) -> None: await self.send_data(self._connects[login], data) - - async def send_data_login(self, login: str, path: Path, file_name: str) -> None: + async def send_file_login(self, login: str, path: Path, file_name: str) -> None: if login not in self._connects: raise ValueError("Unknown login")