Cast Paths to string: pathlib for older pythons doesn't properly work
This commit is contained in:
parent
48197cb222
commit
9ebf2983fe
@ -990,7 +990,7 @@ class Client(Methods, BaseClient):
|
|||||||
|
|
||||||
def load_config(self):
|
def load_config(self):
|
||||||
parser = ConfigParser()
|
parser = ConfigParser()
|
||||||
parser.read(self.config_file)
|
parser.read(str(self.config_file))
|
||||||
|
|
||||||
if self.api_id and self.api_hash:
|
if self.api_id and self.api_hash:
|
||||||
pass
|
pass
|
||||||
|
@ -77,7 +77,7 @@ class FileStorage(MemoryStorage):
|
|||||||
|
|
||||||
if file_exists:
|
if file_exists:
|
||||||
try:
|
try:
|
||||||
with open(path, encoding="utf-8") as f:
|
with open(str(path), encoding="utf-8") as f:
|
||||||
session_json = json.load(f)
|
session_json = json.load(f)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
@ -98,7 +98,7 @@ class FileStorage(MemoryStorage):
|
|||||||
log.warning('Old session file detected: "{}.OLD". You can remove this file now'.format(path.name))
|
log.warning('Old session file detected: "{}.OLD". You can remove this file now'.format(path.name))
|
||||||
|
|
||||||
self.conn = sqlite3.connect(
|
self.conn = sqlite3.connect(
|
||||||
path,
|
str(path),
|
||||||
timeout=1,
|
timeout=1,
|
||||||
check_same_thread=False
|
check_same_thread=False
|
||||||
)
|
)
|
||||||
|
@ -46,7 +46,7 @@ class MemoryStorage(Storage):
|
|||||||
|
|
||||||
def create(self):
|
def create(self):
|
||||||
with self.lock, self.conn:
|
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.executescript(schema.read())
|
||||||
|
|
||||||
self.conn.execute(
|
self.conn.execute(
|
||||||
|
Loading…
Reference in New Issue
Block a user