Support pathlib.Path on download_file

Fixes #1379.
This commit is contained in:
Lonami Exo 2020-06-06 21:07:22 +02:00
parent 4b933069f1
commit 3e511484c7

View File

@ -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()