diff --git a/pyrogram/client.py b/pyrogram/client.py index 74897e5f..40fe1cfe 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -734,13 +734,9 @@ class Client(Methods): if file and not in_memory: file_path = os.path.abspath(re.sub("\\\\", "/", os.path.join(directory, file_name))) os.makedirs(directory, exist_ok=True) + file.close() shutil.move(file.name, file_path) - try: - file.close() - except FileNotFoundError: - pass - return file_path if file and in_memory: