Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/980456 )
Change subject: [cleanup] Cleanup deprecated code
......................................................................
[cleanup] Cleanup deprecated code
- remove infinite rotating file handler
- remove Throttle.multiplydelay attribute
- update documentation
Change-Id: Ic58ddf5a7cdb60d7e51c6371f03b6e25f413cf5a
---
M ROADMAP.rst
M pywikibot/throttle.py
M pywikibot/config.py
M pywikibot/bot.py
4 files changed, 33 insertions(+), 38 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 48a51a0..fc1f35a 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,13 +1,28 @@
Current release
---------------
-* **Python 3.6 support is be discontinued**
+Improvements
+^^^^^^^^^^^^
+
+* (no changes yet)
+
+Bugfixes
+^^^^^^^^
+
+* (no changes yet)
+
+Breaking changes and code cleanups
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+* Infinite rotating file handler with ``config.logfilesize`` of -1 is no longer supported
+* ``Throttle.multiplydelay`` attribute was removed
+* Python 3.6 support was dropped (:phab:`T347026`
Deprecations
------------
-* 8.4.0: Python 3.6 support is deprecated and will be dropped soon with Pywikibot 9
+* 9.0.0: *nullcontext* context manager and *SimpleQueue* queue of :mod:`backports` are derecated
* 8.4.0: *modules_only_mode* parameter of :class:`data.api.ParamInfo`, its *paraminfo_keys* class attribute
and its preloaded_modules property will be removed
* 8.4.0: *dropdelay* and *releasepid* attributes of :class:`throttle.Throttle` will be removed
@@ -55,13 +70,11 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* 6.5.0: OutputOption.output() method will be removed in favour of OutputOption.out property
-* 6.5.0: Infinite rotating file handler with logfilecount of -1 is deprecated
* 6.4.0: 'allow_duplicates' parameter of :func:`tools.itertools.intersect_generators` as positional argument is deprecated, use keyword argument instead
* 6.4.0: 'iterables' of :func:`tools.itertools.intersect_generators` given as a list or tuple is deprecated, either use consecutive iterables or use '*' to unpack
* 6.2.0: outputter of OutputProxyOption without out property is deprecated
* 6.2.0: ContextOption.output_range() and HighlightContextOption.output_range() are deprecated
* 6.2.0: Error messages with '%' style is deprecated in favour for str.format() style
* 6.2.0: page.url2unicode() function is deprecated in favour of tools.chars.url2string()
-* 6.2.0: Throttle.multiplydelay attribute is deprecated
* 6.2.0: SequenceOutputter.format_list() is deprecated in favour of 'out' property
* 6.0.0: config.register_family_file() is deprecated
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 7f60d94..d8b449e 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -142,7 +142,6 @@
UnhandledAnswer,
)
from pywikibot.exceptions import (
- ArgumentDeprecationWarning,
EditConflictError,
Error,
LockedPageError,
@@ -361,8 +360,8 @@
:mod:`pywikibot.logging` module.
.. versionchanged:: 6.2
- Different logfiles are used if multiple processes of the same
- script are running.
+ Different logfiles are used if multiple processes of the same
+ script are running.
"""
module_name = calledModuleName()
if not module_name:
@@ -421,20 +420,10 @@
logfile = config.datafilepath('logs',
f'{module_name}-{pid}bot.log')
- # give up infinite rotating file handler with logfilecount of -1;
- # set it to 999 and use the standard implementation
- max_count = config.logfilecount
- if max_count == -1: # pragma: no cover
- max_count = 999
- issue_deprecation_warning('config.logfilecount with value -1',
- 'any positive number',
- warning_class=ArgumentDeprecationWarning,
- since='6.5.0')
-
file_handler = logging.handlers.RotatingFileHandler(
filename=logfile,
maxBytes=config.logfilesize << 10,
- backupCount=max_count,
+ backupCount=config.logfilecount,
encoding='utf-8'
)
file_handler.namer = handler_namer
diff --git a/pywikibot/config.py b/pywikibot/config.py
index a353b8d..048e30b 100644
--- a/pywikibot/config.py
+++ b/pywikibot/config.py
@@ -620,9 +620,6 @@
# Number of rotating logfiles are created. The older files get the higher
# number. If logfilecount is 0, no logfile will be archived but the current
# logfile will be overwritten if the file size reached the logfilesize above.
-# If logfilecount is -1 there are no rotating logfiles but the files where
-# renamed if the logfile is full. The newest file gets the highest number until
-# some logfiles where deleted.
logfilecount = 5
# set to 1 (or higher) to generate "informative" messages to terminal
verbose_output = 0
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index 66e8b57..bbe20fa 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -81,23 +81,6 @@
self.setDelays()
@property
- @deprecated(since='6.2')
- def multiplydelay(self) -> bool:
- """DEPRECATED attribute.
-
- .. deprecated:: 6.2
- """
- return True
-
- @multiplydelay.setter
- @deprecated(since='6.2')
- def multiplydelay(self) -> None:
- """DEPRECATED attribute setter.
-
- .. deprecated:: 6.2
- """
-
- @property
@deprecated('expiry', since='8.4.0')
def dropdelay(self):
"""Ignore processes that have not made a check in this many seconds.
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/980456
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: Ic58ddf5a7cdb60d7e51c6371f03b6e25f413cf5a
Gerrit-Change-Number: 980456
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
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/+/979673 )
Change subject: [doc] Fix typo in category_redirect.py
......................................................................
[doc] Fix typo in category_redirect.py
Bug: T351951
Change-Id: I78c5cc5c0ec888b5c6d3cc6dbbc01eddcb9ac227
---
M scripts/category_redirect.py
1 file changed, 13 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py
index 04153a6..1b337c1 100755
--- a/scripts/category_redirect.py
+++ b/scripts/category_redirect.py
@@ -14,8 +14,8 @@
-always If used, the bot won't ask if it should add the specified
text
--delay:# Set an amount of days. If the category is edited more recenty
- than given days, ignore it. Default is 7.
+-delay:# Set an amount of days. If the category is edited more
+ recently than given days, ignore it. Default is 7.
-tiny Only loops over Category:Non-empty_category_redirects and
moves all images, pages and categories in redirect categories
@@ -30,7 +30,7 @@
can be set within a settings file which is scripts.ini by default.
"""
#
-# (C) Pywikibot team, 2008-2022
+# (C) Pywikibot team, 2008-2023
#
# Distributed under the terms of the MIT license.
#
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/979673
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: I78c5cc5c0ec888b5c6d3cc6dbbc01eddcb9ac227
Gerrit-Change-Number: 979673
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <dalangi-ctr(a)wikimedia.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged