From a17def80269d99a9dbe90c151d90d5b525935dbd Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 6 Oct 2017 21:48:53 +0200 Subject: [PATCH] Use basename instead abspath for filename attribute (#294) --- telethon/telegram_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 1575be5d..bdaa41d8 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -538,7 +538,7 @@ class TelegramClient(TelegramBareClient): # Take the first element by using [0] since it returns a tuple mime_type = guess_type(file)[0] attributes = [ - DocumentAttributeFilename(os.path.abspath(file)) + DocumentAttributeFilename(os.path.basename(file)) # TODO If the input file is an audio, find out: # Performer and song title and add DocumentAttributeAudio ]