jenkins-bot submitted this change.
[cleanup] make site parameter of http.request mandatory
http.request without site parameter is deprecated for 5 years
and shows a FutureWarning since Pywikibot 5.0. Now make the
site parameter mandatory and remove the old behaviour.
Also remove deprecated ssl deprecation warning; the parameter is
deprecated for 6 years.
Change-Id: I62995b0880eac1d59128d28db90babe9cdb23070
---
M pywikibot/comms/http.py
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index deea88f..1e7f484 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -38,7 +38,6 @@
deprecated,
deprecate_arg,
file_mode_checker,
- issue_deprecation_warning,
PYTHON_VERSION,
)
@@ -217,8 +216,7 @@
return UserAgent().random
-@deprecate_arg('ssl', None)
-def request(site=None, uri: Optional[str] = None, method='GET', params=None,
+def request(site, uri: Optional[str] = None, method='GET', params=None,
body=None, headers=None, data=None, **kwargs) -> str:
"""
Request to Site with default error handling and response decoding.
@@ -244,15 +242,6 @@
if data:
body = data
- assert(site or uri)
- if not site:
- # +1 because of @deprecate_arg
- issue_deprecation_warning(
- 'Invoking http.request without argument site', 'http.fetch()', 3,
- warning_class=FutureWarning, since='20150814')
- r = fetch(uri, method, params, body, headers, **kwargs)
- return r.text
-
kwargs.setdefault('disable_ssl_certificate_validation',
site.ignore_certificate_error())
To view, visit change 646623. To unsubscribe, or for help writing mail filters, visit settings.