Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[BUG] Cannot Download a File if it doesnt have afile_path or ifcustom_path is not provided todownload() #1590

@GabrielSimonetto

Description

@GabrielSimonetto

Steps to reproduce

  1. Create an operation with the above mentioned aspects

Ex:

def run_bot(token):    def make_pasta(update, context):        msg = update.message        if msg.reply_to_message is None:            msg.reply_text(responses.NOT_A_REPLY)            return        if msg.reply_to_message.document is None:            msg.reply_text(responses.NOT_A_DOC)            return        telegram_file = File(msg.reply_to_message.document.file_id)        telegram_file.download()     updater = Updater(token, use_context=True)    dp = updater.dispatcher    dp.add_handler(CommandHandler('hello', hello))    dp.add_handler(CommandHandler('make_pasta', make_pasta))    print('Log: Seu bot iniciou! (:')    updater.start_polling()    updater.idle()

(I know this is not exactly a MWE, sorry)

Expected behaviour

According to the documentation, it should download the file directly to my current working directoryDownload this file. By default, the file is saved in the current working directory with its original filename as reported by Telegram.

Actual behaviour

ontelegram/files/file.py, on the download function, we get a type error sinceself.file_path is NoneType, not str or os.PathLike object

Configuration

Ubuntu 18.04

python-telegram-bot 12.2.0
certifi 2019.09.11
future 0.18.1
Python 3.7.3 (default, Apr 3 2019, 19:16:38) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp