From faab2f451c394e1030ae8c01c50c7dd865768a29 Mon Sep 17 00:00:00 2001 From: CyanBook Date: Fri, 21 Aug 2020 12:34:30 +0200 Subject: [PATCH] Update save_file to accept pathlib objects (#469) --- pyrogram/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 4d0312f4..624c98c6 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -27,7 +27,7 @@ import tempfile from configparser import ConfigParser from hashlib import sha256, md5 from importlib import import_module -from pathlib import Path +from pathlib import Path, Pureapath from signal import signal, SIGINT, SIGTERM, SIGABRT from typing import Union, List, BinaryIO @@ -1804,7 +1804,7 @@ class Client(Methods, BaseClient): part_size = 512 * 1024 - if isinstance(path, str): + if isinstance(path, (str, PurePath)): fp = open(path, "rb") elif isinstance(path, io.IOBase): fp = path