Skip to content

Commit

Permalink
Fix #2674: patch broken ssl.match_hostname() on Python<3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Feb 2, 2018
1 parent ad2366e commit 58be7e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
__all__ = ('BasicAuth', 'Timeout')


if sys.version_info < (3, 7):
import idna_ssl
idna_ssl.patch_match_hostname()


sentinel = object()
Timeout = timeout
NO_EXTENSIONS = bool(os.environ.get('AIOHTTP_NO_EXTENSIONS'))
Expand Down
1 change: 1 addition & 0 deletions requirements/ci-wheel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ coverage==4.4.1
cchardet==2.1.1
cython==0.27.1
chardet==3.0.4
idna-ssl==1.0.0
isort==4.2.15
tox==2.9.1
multidict==4.0.0
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def build_extension(self, ext):


install_requires = ['chardet', 'multidict>=4.0.0',
'async_timeout>=1.2.0', 'yarl>=1.0.0']
'async_timeout>=1.2.0', 'yarl>=1.0.0',
'idna-ssl>=1.0.0']

This comment has been minimized.

Copy link
@hellysmile

hellysmile Feb 2, 2018

Member

idna_ssl https://github.com/aio-libs/idna-ssl/blob/master/setup.py#L38 python_requires='<3.7.0', it means it will break installation aiohttp on Python3.7. There should be dynamical check of Python version to add idna_ssl requirement or not

This comment has been minimized.

Copy link
@asvetlov

asvetlov Feb 2, 2018

Author Member

Nice catch!

This comment has been minimized.

Copy link
@hellysmile

hellysmile Feb 2, 2018

Member

here is a fix #2703



def read(f):
Expand Down

0 comments on commit 58be7e2

Please sign in to comment.