New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timeout argument does not work #1328
Comments
I seem to recall a fix for this maybe landing in master. Could you try using the master version instead? This can be done by uninstalling ptb and then installing it from github using the instructions in the readme. |
I've tried ptb master from repo. Same result. Fails in 5 seconds, even if timeout is set to 60 seconds. |
Tested on PTB from repo Does not work:
Works but it sets global timeout and I need extended timeout only for subset of methods:
|
As I can see, error is here: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/utils/request.py#L324 Timeout parameter is passed to underlying network library only in case of files uploading. |
Looking at it it would seem you're right. I was under the impression that we were testing for it, but it seems like the test case (https://github.com/python-telegram-bot/python-telegram-bot/blob/master/tests/test_bot.py#L620) doesn't go further than Request.post. If you'd like to submit a PR for this that would be great, otherwise we will probably get around to it sometime :) |
PR is ready: #1330 |
Steps to reproduce
Run code:
You can reproduce it only when telegram API server does not respond in 5 seconds. It happens quite often for me :-/
Expected behaviour
If telegram server accepts connection but does not responses for a long time the code should fail in 60 seconds.
Actual behaviour
Code fails in 5 seconds (default library timeout). See traceback below.
Configuration
Operating System:
OS Debian Stretch
Version of Python, python-telegram-bot & dependencies:
Logs
Error traceback:
The text was updated successfully, but these errors were encountered: