jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/872417 )

Change subject: [cleanup] Deprecate Family.maximum_GET_length() method
......................................................................

[cleanup] Deprecate Family.maximum_GET_length() method

Bug: T325957
Change-Id: I921a1da2b03a849d5c4a308b2a1b3725619104d1
---
M pywikibot/family.py
M pywikibot/data/api/_requests.py
2 files changed, 19 insertions(+), 3 deletions(-)

Approvals:
  Matěj Suchánek: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py
index d840b9a..a4d2f6c 100644
--- a/pywikibot/data/api/_requests.py
+++ b/pywikibot/data/api/_requests.py
@@ -658,9 +658,10 @@
             use_get = False  # MIME requests require HTTP POST
         else:
             headers = {'Content-Type': 'application/x-www-form-urlencoded'}
-            if (not self.site.maximum_GET_length()
-                    or self.site.maximum_GET_length() < len(paramstring)):
+            if (not config.maximum_GET_length
+                    or config.maximum_GET_length < len(paramstring)):
                 use_get = False
+
             if use_get:
                 uri = f'{uri}?{paramstring}'
                 body = None
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 981250b..22b83fc 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -597,8 +597,13 @@
             'Found multiple matches for URL "{}": {}'
             .format(url, ', '.join(str(s) for s in matched_sites)))

+    @deprecated('config.maximum_GET_length', since='8.0.0')
     def maximum_GET_length(self, code):
-        """Return the maximum URL length for GET instead of POST."""
+        """Return the maximum URL length for GET instead of POST.
+
+        .. deprecated:: 8.0
+           Use :ref:`config.maximum_GET_length<Account Settings>` instead.
+        """
         return config.maximum_GET_length

     def dbName(self, code) -> str:

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/872417
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I921a1da2b03a849d5c4a308b2a1b3725619104d1
Gerrit-Change-Number: 872417
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to