Fix README: extract_urllib is on the TLDExtract instance, not the module - #362
Merged
john-kurkowski merged 4 commits intoApr 13, 2026
Conversation
Contributor
|
Hi, thanks for the catch, however, on 5.3.1, result = tldextract.TLDExtract().extract_urllib(split_url)
# ExtractResult(subdomain='example', domain='com:8080', suffix='', is_private=False) |
Owner
|
Thanks y'all! |
bmwiedemann
pushed a commit
to bmwiedemann/openSUSE
that referenced
this pull request
Aug 24, 2026
https://build.opensuse.org/request/show/1373149 by user mia + anag_factory - Update to 5.3.2: Bugfixes * Fix reverse_domain_name stray dots when suffix or domain empty gh#john-kurkowski/tldextract#368 Docs * Fix README: extract_urllib is on the instance, not the module gh#john-kurkowski/tldextract#362 * Fix docstring: default cache_dir description gh#john-kurkowski/tldextract#367 * Document hostname representation limits * Document implicit PSL wildcard behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The README example under "How to validate URLs before extraction" calls:
But
extract_urllibdoesn't exist at module level. It's a method onTLDExtractinstances. The module already exportsextract = TLDExtract()as a ready-to-use instance, so the correct call is:Running the original example raises
AttributeError: module 'tldextract' has no attribute 'extract_urllib'.