Repository: python-telegram-bot/python-telegram-bot

Issue:
[BUG] Errors when stopping bot with CTRL-C
### Issue I am facing

When I stop the bot by pressing CTRL-C, I get several errors printed out. This didn't happen with the older version of python-telegram-bot.
The errors can be seen in the traceback. Do I need to catch those errors in the error handler?

### Traceback to the issue

```python
^C2022-05-07 15:46:38,842 - telegram.ext._updater - ERROR - Error while getting Updates: Unknown error in HTTP implementation: CancelledError()
Update None caused error Unknown error in HTTP implementation: CancelledError()
2022-05-07 15:46:38,842 - telegram.ext._application - ERROR - An error was raised and an uncaught error was raised while handling the error with an error_handler.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/python_telegram_bot-20.0a0-py3.7.egg/telegram/ext/_application.py", line 1445, in process_error
    await callback(update, context)
TypeError: object NoneType can't be used in 'await' expression
2022-05-07 15:46:39,844 - telegram.ext._application - INFO - Application is stopping. This might take a moment.
2022-05-07 15:46:39,845 - apscheduler.scheduler - INFO - Scheduler has been shut down
2022-05-07 15:46:39,856 - telegram.ext._application - INFO - Application.stop() complete
```


### Related part of your code

```python
import logging
from telegram import Update
from telegram.ext import Application, CallbackContext, CommandHandler

logging.basicConfig(
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    level=logging.INFO
)

def error(update, context):
        print(f"Update {update} caused error {context.error}")

async def start(update: Update, context: CallbackContext.DEFAULT_TYPE):
    await context.bot.send_message(chat_id=update.effective_chat.id, text="I'm a bot, please talk to me!")

if __name__ == '__main__':
    application = Application.builder().token('TOKEN').build()
    start_handler = CommandHandler('start', start)
    application.add_handler(start_handler)
    application.add_error_handler(error)
    application.run_polling()
```


### Operating System

Debian 10

### Version of Python, python-telegram-bot & dependencies

```shell
python-telegram-bot 20.0a0
Bot API 6.0
Python 3.7.3 (default, Jan 22 2021, 20:04:44)  [GCC 8.3.0]
```



Discussion:

Resolving patch:
diff --git a/telegram/ext/_updater.py b/telegram/ext/_updater.py
--- a/telegram/ext/_updater.py
+++ b/telegram/ext/_updater.py
@@ -309,6 +309,10 @@ async def polling_action_cb() -> bool:
                     pool_timeout=pool_timeout,
                     allowed_updates=allowed_updates,
                 )
+            except asyncio.CancelledError as exc:
+                # TODO: in py3.8+, CancelledError is a subclass of BaseException, so we can drop
+                #  this clause when we drop py3.7
+                raise exc
             except TelegramError as exc:
                 # TelegramErrors should be processed by the network retry loop
                 raise exc
diff --git a/telegram/request/_baserequest.py b/telegram/request/_baserequest.py
--- a/telegram/request/_baserequest.py
+++ b/telegram/request/_baserequest.py
@@ -18,6 +18,7 @@
 # along with this program.  If not, see [http://www.gnu.org/licenses/].
 """This module contains an abstract class to make POST and GET requests."""
 import abc
+import asyncio
 from contextlib import AbstractAsyncContextManager
 from http import HTTPStatus
 from types import TracebackType
@@ -275,6 +276,10 @@ async def _request_wrapper(
                 connect_timeout=connect_timeout,
                 pool_timeout=pool_timeout,
             )
+        except asyncio.CancelledError as exc:
+            # TODO: in py3.8+, CancelledError is a subclass of BaseException, so we can drop this
+            #  clause when we drop py3.7
+            raise exc
         except TelegramError as exc:
             raise exc
         except Exception as exc:


Test patch: