diff --git a/telegram/utils/request.py b/telegram/utils/request.py index f54264ce9..f801c54a3 100644 --- a/telegram/utils/request.py +++ b/telegram/utils/request.py @@ -20,6 +20,7 @@ import json import socket +import logging import certifi import urllib3 @@ -32,6 +33,8 @@ _CON_POOL = None """:type: urllib3.PoolManager""" CON_POOL_SIZE = 1 +logging.getLogger('urllib3').setLevel(logging.WARNING) + def _get_con_pool(): global _CON_POOL @@ -99,7 +102,7 @@ def _request_wrapper(*args, **kwargs): raise TimedOut() except urllib3.exceptions.HTTPError as error: # HTTPError must come last as its the base urllib3 exception class - # TODO: do something smart here; for now just raise NetowrkError + # TODO: do something smart here; for now just raise NetworkError raise NetworkError('urllib3 HTTPError {0}'.format(error)) if 200 <= resp.status <= 299: