diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 2d18d178..e1bebeaf 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -990,7 +990,7 @@ class Client(Methods, BaseClient): def load_config(self): parser = ConfigParser() - parser.read(self.config_file) + parser.read(str(self.config_file)) if self.api_id and self.api_hash: pass diff --git a/pyrogram/client/storage/file_storage.py b/pyrogram/client/storage/file_storage.py index f52a03a9..e6ba8420 100644 --- a/pyrogram/client/storage/file_storage.py +++ b/pyrogram/client/storage/file_storage.py @@ -77,7 +77,7 @@ class FileStorage(MemoryStorage): if file_exists: try: - with open(path, encoding="utf-8") as f: + with open(str(path), encoding="utf-8") as f: session_json = json.load(f) except ValueError: pass @@ -98,7 +98,7 @@ class FileStorage(MemoryStorage): log.warning('Old session file detected: "{}.OLD". You can remove this file now'.format(path.name)) self.conn = sqlite3.connect( - path, + str(path), timeout=1, check_same_thread=False ) diff --git a/pyrogram/client/storage/memory_storage.py b/pyrogram/client/storage/memory_storage.py index 7eb3a7d0..bf000f35 100644 --- a/pyrogram/client/storage/memory_storage.py +++ b/pyrogram/client/storage/memory_storage.py @@ -46,7 +46,7 @@ class MemoryStorage(Storage): def create(self): with self.lock, self.conn: - with open(Path(__file__).parent / "schema.sql", "r") as schema: + with open(str(Path(__file__).parent / "schema.sql"), "r") as schema: self.conn.executescript(schema.read()) self.conn.execute(