mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Resolve filename via pathlib
This commit is contained in:
parent
fb237ca65e
commit
2226ba4b69
1 changed files with 2 additions and 1 deletions
|
|
@ -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.')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue