Resolve filename via pathlib

This commit is contained in:
Alex Root Junior 2020-11-07 23:21:53 +02:00 committed by GitHub
parent fb237ca65e
commit 2226ba4b69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,7 +51,8 @@ class InputFile(base.TelegramObject):
elif isinstance(path_or_bytesio, Path):
self._file = path_or_bytesio.open("rb")
self._path = path_or_bytesio.resolve()
if filename is None:
filename = path_or_bytesio.name
else:
raise TypeError('Not supported file type.')