jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/646623 )
Change subject: [cleanup] make site parameter of http.request mandatory
......................................................................
[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(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
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 https://gerrit.wikimedia.org/r/c/pywikibot/core/+/646623
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: I62995b0880eac1d59128d28db90babe9cdb23070
Gerrit-Change-Number: 646623
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/647610 )
Change subject: [cleanup] remove date.MakeParameter function
......................................................................
[cleanup] remove date.MakeParameter function
MakeParameter is deprecated for 5 years and was replaced with private
function _make_parameter already
Change-Id: I93692f675d8eaae09efbe0161d3cfc4fca7b12b8
---
M pywikibot/date.py
1 file changed, 0 insertions(+), 6 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 541dcbc..0ab693d 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -493,12 +493,6 @@
return newValue
-@deprecated(since='20151014', future_warning=True)
-def MakeParameter(decoder, param):
- """DEPRECATED."""
- return _make_parameter(decoder, param)
-
-
# All years/decades/centuries/millenniums are designed in such a way
# as to allow for easy date to string and string to date conversion.
# For example, using any map with either an integer or a string will produce
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/647610
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: I93692f675d8eaae09efbe0161d3cfc4fca7b12b8
Gerrit-Change-Number: 647610
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/646601 )
Change subject: [clanup] Remove private functions _http_process and _enqueue
......................................................................
[clanup] Remove private functions _http_process and _enqueue
both functions _http_process and _enqueue aren't used by the framework
anymore since Pywikibot 5.0.
Change-Id: I065cc06006bb434f7caa2497ca28d13db1ed97f0
---
M pywikibot/comms/http.py
1 file changed, 0 insertions(+), 99 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index deea88f..552f2ad 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -293,48 +293,6 @@
return None
-@deprecated(since='20201015', future_warning=True)
-def _http_process(session, http_request) -> None: # pragma: no cover
- """DEPRECATED.
-
- Process an `threadedhttp.HttpRequest` instance.
-
- @param session: Session that will be used to process the `http_request`.
- @type session: L{requests.Session}
- @param http_request: Request that will be processed.
- @type http_request: L{threadedhttp.HttpRequest}
- """
- method = http_request.method
- uri = http_request.uri
- params = http_request.params
- body = http_request.body
- headers = http_request.all_headers
- auth = get_authentication(uri)
- if auth is not None and len(auth) == 4:
- if isinstance(requests_oauthlib, ImportError):
- warn('%s' % requests_oauthlib, ImportWarning)
- error('OAuth authentication not supported: %s'
- % requests_oauthlib)
- auth = None
- else:
- auth = requests_oauthlib.OAuth1(*auth)
- timeout = config.socket_timeout
- try:
- ignore_validation = http_request.kwargs.pop(
- 'disable_ssl_certificate_validation', False)
- # Note that the connections are pooled which mean that a future
- # HTTPS request can succeed even if the certificate is invalid and
- # verify=True, when a request with verify=False happened before
- response = session.request(method, uri, params=params, data=body,
- headers=headers, auth=auth, timeout=timeout,
- verify=not ignore_validation,
- **http_request.kwargs)
- except Exception as e:
- http_request.data = e
- else:
- http_request.data = response
-
-
def error_handling_callback(request):
"""
Raise exceptions and log alerts.
@@ -364,63 +322,6 @@
warning('Http response status {}'.format(request.status_code))
-@deprecated(since='20201015', future_warning=True)
-def _enqueue(uri, method='GET', params=None, body=None, headers=None,
- data=None, **kwargs): # pragma: no cover
- """DEPRECATED.
-
- Enqueue non-blocking threaded HTTP request with callback.
-
- Callbacks, including the default error handler if enabled, are run in the
- HTTP thread, where exceptions are logged but are not able to be caught.
- The default error handler is called first, then 'callback' (singular),
- followed by each callback in 'callbacks' (plural). All callbacks are
- invoked, even if the default error handler detects a problem, so they
- must check request.exception before using the response data.
-
- Note: multiple async requests do not automatically run concurrently,
- as they are limited by the number of http threads in L{numthreads},
- which is set to 1 by default.
-
- @see: L{requests.Session.request} for parameters.
-
- @kwarg default_error_handling: Use default error handling
- @type default_error_handling: bool
- @kwarg callback: Method to call once data is fetched
- @type callback: callable
- @kwarg callbacks: Methods to call once data is fetched
- @type callbacks: list of callable
- @rtype: L{threadedhttp.HttpRequest}
- """
- # body and data parameters both map to the data parameter of
- # requests.Session.request.
- if data:
- body = data
-
- default_error_handling = kwargs.pop('default_error_handling', None)
- callback = kwargs.pop('callback', None)
-
- callbacks = []
- if default_error_handling:
- callbacks.append(error_handling_callback)
- if callback:
- callbacks.append(callback)
-
- callbacks += kwargs.pop('callbacks', [])
-
- all_headers = config.extra_headers.copy()
- all_headers.update(headers or {})
-
- user_agent_format_string = all_headers.get('user-agent')
- if not user_agent_format_string or '{' in user_agent_format_string:
- all_headers['user-agent'] = user_agent(None, user_agent_format_string)
-
- request = threadedhttp.HttpRequest(
- uri, method, params, body, all_headers, callbacks, **kwargs)
- _http_process(session, request)
- return request
-
-
@deprecate_arg('callback', True)
def fetch(uri, method='GET', params=None, body=None, headers=None,
default_error_handling: bool = True,
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/646601
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: I065cc06006bb434f7caa2497ca28d13db1ed97f0
Gerrit-Change-Number: 646601
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/647724 )
Change subject: [doc] Fix spelling
......................................................................
[doc] Fix spelling
Change-Id: I57a2c29a5520b800af544dcfae27af7fc9a3b7ad
---
M pywikibot/page/__init__.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 8e6fe80..c975ba7 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -635,7 +635,7 @@
try:
self.botMayEdit() # T262136, T267770
except Exception as e:
- # dry tests aren't able to make an API call but are
+ # dry tests aren't able to make an API call
# but are rejected by an Exception; ignore it then.
if not str(e).startswith('DryRequest rejecting request:'):
raise
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/647724
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: I57a2c29a5520b800af544dcfae27af7fc9a3b7ad
Gerrit-Change-Number: 647724
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/647604 )
Change subject: [5.2.1] Update Pywikibot version
......................................................................
[5.2.1] Update Pywikibot version
- Update Pywikibot version to 5.2.1.dev0 development release
- upate ROADMAP.rst and HISTORY.rst files
Change-Id: I53c733c2326da50b54596d068f4dbd2137babe62
---
M HISTORY.rst
M ROADMAP.rst
M pywikibot/__metadata__.py
3 files changed, 43 insertions(+), 37 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/HISTORY.rst b/HISTORY.rst
index 21cc668..c182e68 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,6 +1,47 @@
Release history
===============
+5.2.0
+-----
+*10 December 2020*
+
+* Remove deprecated args for Page.protect() (T227610)
+* Move BaseSite its own site/_basesite.py file
+* Improve toJSON() methods in page.__init__.py
+* _is_wikibase_error_retryable rewritten (T48535, 268645)
+* Replace FrozenDict with frozenmap
+* WikiStats table may be sorted by any key
+* Retrieve month names from mediawiki_messages when required
+* Move Namespace and NamespacesDict to site/_namespace.py file
+* Fix TypeError in api.LoginManager (T268445)
+* Add repr() method to BaseDataDict and ClaimCollection
+* Define availableOptions as deprecated property
+* Do not strip all whitespaces from Link.title (T197642)
+* Introduce a common BaseDataDict as parent for LanguageDict and AliasesDict
+* Replaced PageNotSaved by PageSaveRelatedError (T267821)
+* Add -site option as -family -lang shortcut
+* Enable APISite.exturlusage() with default parameters (T266989)
+* Update tools._unidata._category_cf from Unicode version 13.0.0
+* Move TokenWallet to site/_tokenwallet.py file
+* Fix import of httplib after release of requests 2.25 (T267762)
+* user keyword parameter can be passed to Site.rollbackpage() (T106646)
+* Check for {{bots}}/{{nobots}} templates in Page.text setter (T262136, T267770)
+* Remove deprecated UserBlocked exception and Page.contributingUsers()
+* Add support for some 'wbset' actions in DataSite
+* Fix UploadRobot site attribute (T267573)
+* Ignore UnicodeDecodeError on input (T258143)
+* Replace 'source' exception regex with 'syntaxhighlight' (T257899)
+* Fix get_known_families() for wikipedia_family (T267196)
+* Move _InterwikiMap class to site/_interwikimap.py
+* instantiate a CosmeticChangesToolkit by passing a page
+* Create a Site from sitename
+* pywikibot.Site() parameters "interface" and "url" must be keyworded
+* Lookup the code parameter in xdict first (T255917)
+* Remove interwiki_forwarded_from list from family files (T104125)
+* Rewrite Revision class; each data can be accessed either by key or as an attribute (T102735, T259428)
+* L10N-Updates
+
+
5.1.0
-----
diff --git a/ROADMAP.rst b/ROADMAP.rst
index f11b7d9..590a2d0 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,42 +1,7 @@
Current release changes
~~~~~~~~~~~~~~~~~~~~~~~
-* Remove deprecated args for Page.protect() (T227610)
-* Move BaseSite its own site/_basesite.py file
-* Improve toJSON() methods in page.__init__.py
-* _is_wikibase_error_retryable rewritten (T48535, 268645)
-* Replace FrozenDict with frozenmap
-* WikiStats table may be sorted by any key
-* Retrieve month names from mediawiki_messages when required
-* Move Namespace and NamespacesDict to site/_namespace.py file
-* Fix TypeError in api.LoginManager (T268445)
-* Add repr() method to BaseDataDict and ClaimCollection
-* Define availableOptions as deprecated property
-* Do not strip all whitespaces from Link.title (T197642)
-* Introduce a common BaseDataDict as parent for LanguageDict and AliasesDict
-* Replaced PageNotSaved by PageSaveRelatedError (T267821)
-* Add -site option as -family -lang shortcut
-* Enable APISite.exturlusage() with default parameters (T266989)
-* Update tools._unidata._category_cf from Unicode version 13.0.0
-* Move TokenWallet to site/_tokenwallet.py file
-* Fix import of httplib after release of requests 2.25 (T267762)
-* user keyword parameter can be passed to Site.rollbackpage() (T106646)
-* Check for {{bots}}/{{nobots}} templates in Page.text setter (T262136, T267770)
-* Remove deprecated UserBlocked exception and Page.contributingUsers()
-* Add support for some 'wbset' actions in DataSite
-* Fix UploadRobot site attribute (T267573)
-* Ignore UnicodeDecodeError on input (T258143)
-* Replace 'source' exception regex with 'syntaxhighlight' (T257899)
-* Fix get_known_families() for wikipedia_family (T267196)
-* Move _InterwikiMap class to site/_interwikimap.py
-* instantiate a CosmeticChangesToolkit by passing a page
-* Create a Site from sitename
-* pywikibot.Site() parameters "interface" and "url" must be keyworded
-* Lookup the code parameter in xdict first (T255917)
-* Remove interwiki_forwarded_from list from family files (T104125)
-* Rewrite Revision class; each data can be accessed either by key or as an attribute (T102735, T259428)
-* L10N-Updates
-
+* (no changes yet)
Future release notes
~~~~~~~~~~~~~~~~~~~~
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index 4eb6448..b05fe6e 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -6,7 +6,7 @@
# Distributed under the terms of the MIT license.
#
__name__ = 'pywikibot'
-__version__ = '5.2.0'
+__version__ = '5.2.1.dev0'
__description__ = 'Python MediaWiki Bot Framework'
__maintainer__ = 'The Pywikibot team'
__maintainer_email__ = 'pywikibot(a)lists.wikimedia.org'
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/647604
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: I53c733c2326da50b54596d068f4dbd2137babe62
Gerrit-Change-Number: 647604
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged