From 37e1e50789c7a5c29f8dd10b1a742c1108355885 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 17 Apr 2025 11:11:33 +0200 Subject: [PATCH] userscripts: Properly avoid tldextract warning The previous fix in 3dc212a81520237318f65d130def2a9229eca2d9 was insufficient, as the inner `getattr(extract_result, "registered_domain")` was always evaluated first (thus triggering the deprecation warning again). We also cannot do: getattr(extract_result, "top_domain_under_public_suffix", None) or extract_result.registered_domain as `""` is a valid value for it. --- doc/changelog.asciidoc | 8 ++++++++ misc/userscripts/qute-bitwarden | 8 ++++---- misc/userscripts/qute-lastpass | 8 ++++---- misc/userscripts/qute-pass | 8 ++++---- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 9afb2a0f1..1081bbc40 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -19,6 +19,14 @@ breaking changes (such as renamed commands) can happen in minor releases. v3.5.1 (unreleased) ------------------- +Fixed +~~~~~ + +- Resolved issues in userscripts: + * `qute-bitwarden`, `-lastpass` and `-pass` now properly avoid a + `DeprecationWarning` from the upcoming 6.0 release of `tldextract`. + The previous fix in v3.5.1 was insufficient. + [[v3.5.0]] v3.5.0 (2025-04-12) ------------------- diff --git a/misc/userscripts/qute-bitwarden b/misc/userscripts/qute-bitwarden index 6a34318f7..4e7557727 100755 --- a/misc/userscripts/qute-bitwarden +++ b/misc/userscripts/qute-bitwarden @@ -208,10 +208,10 @@ def main(arguments): None, [ extract_result.fqdn, - getattr( - extract_result, - "top_domain_under_public_suffix", - getattr(extract_result, "registered_domain"), + ( + extract_result.top_domain_under_public_suffix + if hasattr(extract_result, "top_domain_under_public_suffix") + else extract_result.registered_domain ), extract_result.subdomain + "." + extract_result.domain, extract_result.domain, diff --git a/misc/userscripts/qute-lastpass b/misc/userscripts/qute-lastpass index 44c68aca4..5a7658699 100755 --- a/misc/userscripts/qute-lastpass +++ b/misc/userscripts/qute-lastpass @@ -121,10 +121,10 @@ def main(arguments): None, [ extract_result.fqdn, - getattr( - extract_result, - "top_domain_under_public_suffix", - getattr(extract_result, "registered_domain"), + ( + extract_result.top_domain_under_public_suffix + if hasattr(extract_result, "top_domain_under_public_suffix") + else extract_result.registered_domain ), extract_result.subdomain + extract_result.domain, extract_result.domain, diff --git a/misc/userscripts/qute-pass b/misc/userscripts/qute-pass index 1023798cb..902f785fd 100755 --- a/misc/userscripts/qute-pass +++ b/misc/userscripts/qute-pass @@ -247,10 +247,10 @@ def main(arguments): None, [ extract_result.fqdn, - getattr( - extract_result, - "top_domain_under_public_suffix", - getattr(extract_result, "registered_domain"), + ( + extract_result.top_domain_under_public_suffix + if hasattr(extract_result, "top_domain_under_public_suffix") + else extract_result.registered_domain ), extract_result.ipv4, private_domain,