Visitar URL original
Update save_file to accept pathlib objects (#469) · EVAyo/pyrogram@faab2f4 · GitHub
Skip to content

Commit faab2f4

Browse files
authored
Update save_file to accept pathlib objects (pyrogram#469)
1 parent ce0ddcd commit faab2f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎pyrogram/client/client.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from configparser import ConfigParser
2828
from hashlib import sha256, md5
2929
from importlib import import_module
30-
from pathlib import Path
30+
from pathlib import Path, Pureapath
3131
from signal import signal, SIGINT, SIGTERM, SIGABRT
3232
from typing import Union, List, BinaryIO
3333

@@ -1804,7 +1804,7 @@ async def worker(session):
18041804

18051805
part_size = 512 * 1024
18061806

1807-
if isinstance(path, str):
1807+
if isinstance(path, (str, PurePath)):
18081808
fp = open(path, "rb")
18091809
elif isinstance(path, io.IOBase):
18101810
fp = path

0 commit comments

Comments
 (0)