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':
Python3.7.7 (default, Mar142020, 02:39:38)
[Clang11.0.0 (clang-1100.0.33.17)] ondarwinType"help", "copyright", "credits"or"license"formoreinformation.
>>>frompublicsuffix2importPublicSuffixList>>>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
publicsuffix2mishandles 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 ofgit-pages.rit.eduas a public suffix,get_tld('rit.edu')returns'rit.edu', whereas it really should return'edu':