1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Make create_dir() method cross-platform instead of POSIX only.

Fix for issue #1869
This commit is contained in:
Cub11k
2023-01-06 22:36:08 +02:00
parent e6f8acadf4
commit c27f60b94b
3 changed files with 14 additions and 14 deletions

View File

@ -28,7 +28,7 @@ class StatePickleStorage(StateStorageBase):
"""
Create directory .save-handlers.
"""
dirs = self.file_path.rsplit('/', maxsplit=1)[0]
dirs, filename = os.path.split(self.file_path)
os.makedirs(dirs, exist_ok=True)
if not os.path.isfile(self.file_path):
with open(self.file_path,'wb') as file: