diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index 334f28a4..1b06bfe6 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -443,6 +443,9 @@ class DownloadMethods: raise ValueError( 'The part size must be evenly divisible by 4096.') + if isinstance(file, pathlib.Path): + file = str(file.absolute()) + in_memory = file is None or file is bytes if in_memory: f = io.BytesIO()