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.
pywikibot-commits@lists.wikimedia.org