From 0694480a461337bb5764f900d7294487b0c73492 Mon Sep 17 00:00:00 2001 From: Eric Blundell Date: Tue, 20 Mar 2018 08:33:14 -0500 Subject: [PATCH] allow file objects be passed to file_name arg of client.download_media --- pyrogram/client/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index c2854796..a53225a0 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -516,7 +516,7 @@ class Client: # Make file_dir if it was specified os.makedirs(file_dir, exist_ok=True) - if file_name is not None: + if isinstance(file_name, str) and file_name is not None: os.makedirs(os.path.dirname(file_name), exist_ok=True) if isinstance(media, types.MessageMediaDocument):