MicroProger
@MicroProger
Работает - не трогай

Что делать если выдается в Python oшибка TTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot6288995708?

Пытаюсь отправить через telebot zip-файл. Вдается следующая ошибка:
ошибка
HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot6288995708:AAGtDcx6_VChmFUh5FPk1SA64nZWEvmaWtY/sendDocument?chat_id=968218637 (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2396)')))
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2396)

During handling of the above exception, another exception occurred:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot6288995708:AAGtDcx6_VChmFUh5FPk1SA64nZWEvmaWtY/sendDocument?chat_id=968218637 (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2396)')))

During handling of the above exception, another exception occurred:

File "C:\Users\user\Desktop\StillerTelegram\telegram.py", line 33, in get_start
bot.send_document(message.from_user.id, file)
File "C:\Users\user\Desktop\StillerTelegram\telegram.py", line 42, in
bot.polling(none_stop=True, interval=0, timeout=123)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot6288995708:AAGtDcx6_VChmFUh5FPk1SA64nZWEvmaWtY/sendDocument?chat_id=968218637 (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2396)')))


ошибка выдается в следующих строках:
with open('YourStiller.zip', 'rb') as file:
        bot.send_document(message.from_user.id, file)


изменил эту строку, не помогло
bot.polling(none_stop=True, interval=0, timeout=123)

было
bot.polling(none_stop=True, interval=0)

Надеюсь я дал достаточно информации
  • Вопрос задан
  • 552 просмотра
Решения вопроса 1
MicroProger
@MicroProger Автор вопроса
Работает - не трогай
Разобрался в проблеме. Телеграм разрешает отправку файлов не более, чем 50 МБ, поэтому выдает ошибку.
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы