Skip to content

Progress callback or whole send_file method is broken #3190

@ruslanzelinskyy

Description

@ruslanzelinskyy

Checklist

  • The error is in the library's code, and not in my own.
  • I have searched for this issue before posting it and there isn't a duplicate.
  • I ran pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip and triggered the bug in the latest version.

Code that causes the issue

bar = progressbar.ProgressBar(maxval=0).start()
def prog(current, total):
    bar = progressbar.ProgressBar(maxval=total).start()
    bar.update(current)
   
#broken:
client.send_file(channel, file=inputFileName, caption=remoteFileName, progress_callback=prog)
#fine:
client.download_media(message, file=outputFileName, progress_callback=prog)

Traceback

freezes, no output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis bug affects actual users and should be fixed (medium priority)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions