models.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:ghostlines-robofont 作者: ghostlines 项目源码 文件源码
def _get_idna_encoded_host(host):
        try:
            from .packages import idna
        except ImportError:
            # tolerate the possibility of downstream repackagers unvendoring `requests`
            # For more information, read: packages/__init__.py
            import idna
            sys.modules['requests.packages.idna'] = idna

        try:
            host = idna.encode(host, uts46=True).decode('utf-8')
        except idna.IDNAError:
            raise UnicodeError
        return host
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号