From b39d6b13a05bc12f39b559734a2dfb60cbc23e1a Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Sun, 18 Aug 2024 20:00:39 +0200 Subject: [PATCH 1/2] Remove surplus logging from updater network loop --- telegram/ext/_updater.py | 1 - 1 file changed, 1 deletion(-) diff --git a/telegram/ext/_updater.py b/telegram/ext/_updater.py index bdf14e0a920..30635e40ada 100644 --- a/telegram/ext/_updater.py +++ b/telegram/ext/_updater.py @@ -763,7 +763,6 @@ async def do_action() -> bool: _LOGGER.exception("Invalid token; aborting") raise except TelegramError as telegram_exc: - _LOGGER.exception("Error while %s:", description) on_err_cb(telegram_exc) # increase waiting times on subsequent errors up to 30secs From d09342b8205559e7ef8c73f5fe182aa5f5d1a5dd Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Sun, 18 Aug 2024 20:58:24 +0200 Subject: [PATCH 2/2] Adjust test --- tests/ext/test_updater.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ext/test_updater.py b/tests/ext/test_updater.py index f7216100836..84a86c988da 100644 --- a/tests/ext/test_updater.py +++ b/tests/ext/test_updater.py @@ -571,7 +571,7 @@ async def get_updates(*args, **kwargs): else: assert len(caplog.records) > 0 assert any( - "Error while getting Updates:" in record.getMessage() + "Exception happened while polling for updates." in record.getMessage() and record.name == "telegram.ext.Updater" for record in caplog.records ) @@ -593,7 +593,7 @@ async def get_updates(*args, **kwargs): else: assert len(caplog.records) > 0 assert any( - "Error while getting Updates:" in record.getMessage() + "Exception happened while polling for updates." in record.getMessage() and record.name == "telegram.ext.Updater" for record in caplog.records )