Fix #2811: Show warning if requests < 2.4.1

This commit is contained in:
Takeshi KOMIYA 2016-07-27 13:28:07 +09:00
parent b208b3e9e0
commit 54247c96fe

View File

@ -54,6 +54,13 @@ except pkg_resources.DistributionNotFound:
'install "requests[security]" as a dependency or upgrade to '
'a python version with SNI support (Python 3 and Python 2.7.9+).'
)
except pkg_resources.UnknownExtra:
warnings.warn(
'Some links may return broken results due to being unable to '
'check the Server Name Indication (SNI) in the returned SSL cert '
'against the hostname in the url requested. Recommended to '
'install requests-2.4.1+.'
)
requests_user_agent = [('User-agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:25.0) '
'Gecko/20100101 Firefox/25.0')]