Giter Club home page Giter Club logo

idna-ssl's Introduction

idna-ssl

info

Patch ssl.match_hostname for Unicode(idna) domains support

image

image

image

Installation

pip install idna-ssl

Usage

from idna_ssl import patch_match_hostname  # noqa isort:skip
patch_match_hostname()  # noqa isort:skip

import asyncio

import aiohttp

URL = 'https://цфоут.мвд.рф/news/item/8065038/'


async def main():
    async with aiohttp.ClientSession() as session:
        async with session.get(URL) as response:
            print(response)


loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Motivation

  • Here is 100% backward capability
  • Related aiohttp issue
  • Related Python bug
  • Related Python pull request
  • It is fixed (by January 27 2018) in upcoming Python 3.7, but IDNA2008 is still broken

Thanks

The library was donated by Ocean S.A.

Thanks to the company for contribution.

idna-ssl's People

Contributors

asvetlov avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar hellysmile avatar jayvdb avatar pyup-bot avatar webknjaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

idna-ssl's Issues

Fix 3.7.2 support

Since Python 3.7 is supported it should support 3.7.* and not only 3.7.0.

Python 3.7 support

Hey, my piplines for 3.7.-dev are failing because idna-ssl requires <3.7.0. Could this be checked for compatibility and bumped in requirements? :)

Add support for Python 3.7

Python 3.7 was just released. I believe that there are no breaking changes with idna-ssl. However, it's metadata doesn't allow for the package to be installed in that Python version:

$ pip install idna-ssl
Collecting idna-ssl
  Using cached https://files.pythonhosted.org/packages/44/f4/97f7a58e814b3523a5e68bc8095c36cfa6daffb35f01b25248ec4605f53e/idna_ssl-1.0.0.tar.gz
idna-ssl requires Python '<3.7.0' but the running Python is 3.7.0

It would be great if support were added to Python 3.7.

Open support for Python 3.7

setup.py still requires python_requires='<3.7.0' (line 38), while the README seems to indicate that it's ready for 3.7.

cannot install on ubuntu

I'm trying to install idna-ssl on ubuntu 16.04, but I get this error. Thanks a lot for help.

pip3.6 install idna-ssl

Collecting idna-ssl
Using cached https://files.pythonhosted.org/packages/46/03/07c4894aae38b0de52b52586b24bf189bb83e4ddabfe2e2c8f2419eec6f4/idna-ssl-1.1.0.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8s8q3slc/idna-ssl/setup.py'"'"'; file='"'"'/tmp/pip-install-8s8q3slc/idna-ssl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-8s8q3slc/idna-ssl/
Complete output (39 lines):
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/.local/lib/python3.6/site-packages/setuptools/init.py", line 12, in
from setuptools.extension import Extension
File "/home/ubuntu/.local/lib/python3.6/site-packages/setuptools/extension.py", line 7, in
from setuptools.dist import _get_unpatched
File "/home/ubuntu/.local/lib/python3.6/site-packages/setuptools/dist.py", line 16, in
import pkg_resources
File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources.py", line 1479, in
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in
import apt
File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ubuntu/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 12, in <module>
    from setuptools.extension import Extension
  File "/home/ubuntu/.local/lib/python3.6/site-packages/setuptools/extension.py", line 7, in <module>
    from setuptools.dist import _get_unpatched
  File "/home/ubuntu/.local/lib/python3.6/site-packages/setuptools/dist.py", line 16, in <module>
    import pkg_resources
  File "/home/ubuntu/.local/lib/python3.6/site-packages/pkg_resources.py", line 1479, in <module>
    register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 19.2.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.