Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

pages.example.com suffix declaration causes get_tld('example.com') == 'example.com'

未关闭
#18 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
networking

调研方向

从 PublicSuffixList.get_tld 入口开始,使用 git-pages.rit.edu 这样的后缀重现 issue 中的示例。了解公共后缀声明是如何与父域名进行匹配的。当 get_tld('foo.git-pages.rit.edu') 仍返回 git-pages.rit.edu,而 get_tld('git-pages.rit.edu') 和 get_tld('rit.edu') 返回 edu 时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

publicsuffix2 mishandles the case where, given the declaration of some public suffix, all suffixes of that suffix are seen as their own TLDs. E.g., given the declaration of git-pages.rit.edu as a public suffix, get_tld('rit.edu') returns 'rit.edu', whereas it really should return 'edu':

Python 3.7.7 (default, Mar 14 2020, 02:39:38)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from publicsuffix2 import PublicSuffixList
>>> psl = PublicSuffixList()
>>> psl.get_tld("foo.git-pages.rit.edu")
'git-pages.rit.edu'  # CORRECT
>>> psl.get_tld("git-pages.rit.edu")
'git-pages.rit.edu'  # WRONG, should be 'edu'
>>> psl.get_tld("rit.edu")
'rit.edu'            # WRONG, should be 'edu'
>>> psl.get_tld("edu")
'edu'                # CORRECT, but probably out of accident
主要语言
Python
星标
30
派生
16
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aboutcode-org/python-publicsuffix2 的其他 Issue

查看 aboutcode-org/python-publicsuffix2 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。