Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235351?usp=email )
Change subject: archivebot: make TimeStripper more resilient for itwiki
......................................................................
archivebot: make TimeStripper more resilient for itwiki
Bug: T415880
Change-Id: I585c914c283a2d267d317150c75ba39d223c2068
---
M pywikibot/textlib.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 5e08c36..48b0ab6 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -2235,8 +2235,8 @@
self.origNames2monthNum = {}
# use first_lower/first_upper for those language where month names
- # were changed: T324310, T356175
- if self.site.lang in ('hy', 'vi'):
+ # were changed: T324310, T356175, T415880
+ if self.site.lang in ('hy', 'it', 'vi'):
functions = [first_upper, first_lower]
else:
functions = [str]
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235351?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I585c914c283a2d267d317150c75ba39d223c2068
Gerrit-Change-Number: 1235351
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235350?usp=email )
Change subject: Revert "archivebot: make TimeStripper more resilient for itwiki"
......................................................................
Revert "archivebot: make TimeStripper more resilient for itwiki"
This reverts commit e3e88edbcd65d4e8e2da5fce2a13552b709feb92.
Reason for revert: should only be changed on master branch
Change-Id: I988ae2700b86e604c6a850d5f108d7c0eb6c2bc7
---
M pywikibot/textlib.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index beb5bdc..97ea55a 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1,6 +1,6 @@
"""Functions for manipulating wiki-text."""
#
-# (C) Pywikibot team, 2008-2026
+# (C) Pywikibot team, 2008-2025
#
# Distributed under the terms of the MIT license.
#
@@ -2234,8 +2234,8 @@
self.origNames2monthNum = {}
# use first_lower/first_upper for those language where month names
- # were changed: T324310, T356175, T415880
- if self.site.lang in ('hy', 'it', 'vi'):
+ # were changed: T324310, T356175
+ if self.site.lang in ('hy', 'vi'):
functions = [first_upper, first_lower]
else:
functions = [str]
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235350?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: stable
Gerrit-Change-Id: I988ae2700b86e604c6a850d5f108d7c0eb6c2bc7
Gerrit-Change-Number: 1235350
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235233?usp=email )
Change subject: tests: still more time required for windows tests after get throttle
......................................................................
tests: still more time required for windows tests after get throttle
Change-Id: I3e6646627c0f535128664cc30c5ad97eb92b721d
Signed-off-by: Xqt <info(a)gno.de>
---
M .github/workflows/windows_tests.yml
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/.github/workflows/windows_tests.yml b/.github/workflows/windows_tests.yml
index 549d549..af5916e 100644
--- a/.github/workflows/windows_tests.yml
+++ b/.github/workflows/windows_tests.yml
@@ -18,7 +18,7 @@
build:
runs-on: windows-latest
continue-on-error: ${{ matrix.experimental || false }}
- timeout-minutes: 75
+ timeout-minutes: 120
strategy:
fail-fast: false
matrix:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235233?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I3e6646627c0f535128664cc30c5ad97eb92b721d
Gerrit-Change-Number: 1235233
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1234930?usp=email )
Change subject: sphinx: Use Sphinx 8.2.3 for documentation
......................................................................
sphinx: Use Sphinx 8.2.3 for documentation
Sphinx 9 breaks the documentation and several files are missing.
Bug: T413563
Change-Id: Ia0cbcd52b12c1dc969c17b5f4ca54a06bf5951c4
---
M docs/requirements.txt
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 40ec37e..95cf7ea 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,7 +1,7 @@
# This is a PIP requirements file for building Sphinx documentation of Pywikibot
# ../requirements.txt is also needed.
-# Note: Python 3.11 is required for sphinx 8.2
-sphinx >= 8.2.3
+# Note: Python 3.11 is required for sphinx 8.2+
+sphinx == 8.2.3
rstcheck >=6.2.5
sphinxext-opengraph >= 0.13.0
sphinx-copybutton >= 0.5.2
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1234930?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: stable
Gerrit-Change-Id: Ia0cbcd52b12c1dc969c17b5f4ca54a06bf5951c4
Gerrit-Change-Number: 1234930
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1234434?usp=email )
Change subject: Revert "IMPR: Use singledispatchmethod with SiteLinkCollection.normalizeData"
......................................................................
Revert "IMPR: Use singledispatchmethod with SiteLinkCollection.normalizeData"
This reverts commit f74c5ff04b71716658d34a0708c4b1c7756bce86.
Reason for revert: There is a bug upstream in Python 3.9:
https://github.com/python/cpython/issues/83860
This was fixed in 3.10 and probably in 3.9.8+
Change-Id: I289faf6818d5c5bb525d5a1f448eb7d942ff0e08
---
M pywikibot/page/_collections.py
1 file changed, 21 insertions(+), 36 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/pywikibot/page/_collections.py b/pywikibot/page/_collections.py
index a4ea78e..b95b059 100644
--- a/pywikibot/page/_collections.py
+++ b/pywikibot/page/_collections.py
@@ -9,7 +9,6 @@
import reprlib
from collections import defaultdict
from collections.abc import MutableMapping, MutableSequence
-from functools import singledispatchmethod
from typing import Any
import pywikibot
@@ -417,48 +416,34 @@
return {'site': db_name, 'title': obj.title()}
return obj
- @singledispatchmethod
@classmethod
- def normalizeData(cls, data) -> dict:
+ def normalizeData(cls, data: list | dict[str, Any]) -> dict:
"""Helper function to expand data into the Wikibase API structure.
:param data: Data to normalize
- :type data: dict | list
:return: The dict with normalized data
- :raises ValueError: Couldn't determine the site and title or the
- key doesn't match the site within *data* collection.
- :raises TypeError: Unsupported type for *data*
"""
- raise TypeError(f'Unsupported type: {type(data)}')
-
- @normalizeData.register
- @classmethod
- def _(cls, data: dict) -> dict:
norm_data = {}
- for key, obj in data.items():
- key = cls.getdbName(key)
- json = cls._extract_json(obj)
- if isinstance(json, str):
- json = {'site': key, 'title': json}
- elif key != json['site']:
- raise ValueError(
- "Key '{}' doesn't match the site of the value: '{}'"
- .format(key, json['site']))
- norm_data[key] = json
- return norm_data
-
- @normalizeData.register
- @classmethod
- def _(cls, data: list) -> dict:
- norm_data = {}
- for obj in data:
- json = cls._extract_json(obj)
- if not isinstance(json, dict):
- raise ValueError(
- "Couldn't determine the site and title of the value: "
- f'{json!r}')
- db_name = json['site']
- norm_data[db_name] = json
+ if isinstance(data, dict):
+ for key, obj in data.items():
+ key = cls.getdbName(key)
+ json = cls._extract_json(obj)
+ if isinstance(json, str):
+ json = {'site': key, 'title': json}
+ elif key != json['site']:
+ raise ValueError(
+ "Key '{}' doesn't match the site of the value: '{}'"
+ .format(key, json['site']))
+ norm_data[key] = json
+ else:
+ for obj in data:
+ json = cls._extract_json(obj)
+ if not isinstance(json, dict):
+ raise ValueError(
+ "Couldn't determine the site and title of the value: "
+ f'{json!r}')
+ db_name = json['site']
+ norm_data[db_name] = json
return norm_data
def toJSON(self, diffto: dict | None = None) -> dict:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1234434?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I289faf6818d5c5bb525d5a1f448eb7d942ff0e08
Gerrit-Change-Number: 1234434
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1234364?usp=email )
Change subject: Update ROADMAP.rst, CHANGELOG.rst, HISTORY.rst and AUTHORS.rst
......................................................................
Update ROADMAP.rst, CHANGELOG.rst, HISTORY.rst and AUTHORS.rst
Change-Id: I36cd3897e29cf9c40ba5a5b8014ff4de6d8689f2
---
M AUTHORS.rst
M HISTORY.rst
M ROADMAP.rst
M pywikibot/__metadata__.py
M scripts/CHANGELOG.rst
5 files changed, 48 insertions(+), 9 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/AUTHORS.rst b/AUTHORS.rst
index 6519403..fb1f9fe 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -11,6 +11,7 @@
adiyetichaves
Ævar Arnfjörð Bjarmason
akashagarwal
+ Akaza24
AkshitKumar
Alangi Derick
Alex Shih-Han Lin
@@ -134,6 +135,7 @@
::
+ Harshita
Hazard-SJ
Huji
Homeboy445
diff --git a/HISTORY.rst b/HISTORY.rst
index 8437e93..744f991 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,9 +1,16 @@
Release History
===============
+10.7.5
+------
+*28 January 2026*
+
+* Add support for kajwiki. (:phab:`T415040`)
+
+
10.7.4
------
-*10 December 2025*
+*13 December 2025*
* Fix extracting password line (:phab:`T412191`)
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 4111ff9..86dd03e 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -3,6 +3,17 @@
**Improvements**
+* Add WikiWho API support. (:phab:`T414071`)
+* Never use None as key in WeakKeyDictionary within :class:`proofreadpage.TagAttrDesc`.
+ Class-level access returns the descriptor itself. (:phab:`T413563`)
+* *text_a* and *text_b* of :class:`diff.PatchManager` are positional-only parameters.
+ *by_letter* and *replace_invisible* are keyword-only parameters.
+* Optimize :func:`pagegenerators.SubCategoriesPageGenerator`
+* Consider ``retry_after`` in delay calculation of :meth:`throttle.Throttle.get_delay`.
+ (:phab:`T414354`)
+* Remove protocol swapping in :class:`data.api.Request`. (:phab:`T414369`)
+* Use environment variables ``PYWIKIBOT_USERNAME`` or ``PWB_USERNAME`` for ``User-Agent`` username
+ if username isn't set in :mod:`user-config.py<config>` for a given site. (:phab:`T414201`)
* Add support for beta site in :class:`families.meta_family.Family` (:phab:`T413060`)
* Add user agent to :class:`data.api.Request` error log (:phab:`T414170`)
* Increase performance of delegation for :class:`BaseSite<pywikibot.site._basesite.BaseSite>`
@@ -11,23 +22,27 @@
* Use :class:`backports.RLock` instead of Queue to signal async_manager activity (:phab:`T147178`)
* Add :meth:`User.is_partial_blocked()<pywikibot.User.is_partial_blocked>` and methods
:meth:`APISite.is_partial_blocked()<pywikibot.site._apisite.APISite.is_partial_blocked>` to detect
- partial blocks (:phab:`T412613`)
+ partial blocks. (:phab:`T412613`)
* Add :meth:`get_block_info()<pywikibot.User.get_block_info>` method to :class:`pywikibot.User`
class to retrieve detailed block information including block ID, reason, expiry, and restrictions
(:phab:`T412613`)
* Java based GraalPy is supported but Pillow cannot be used (:phab:`T412739`)
-* Free threading Python is supported with some restrictions
+* Free threading Python is supported with some restrictions.
(:phab:`T408131`, :phab:`T412605`, :phab:`T412624`)
-* i18n updates
-* Provide a security policy with Pywikibot (:phab:`T410753`)
+* i18n updates.
+* Provide a security policy with Pywikibot. (:phab:`T410753`)
* Show a friendly install message with :mod:`pwb<pywikibot.scripts.wrapper>` wrapper
- when mandatory packages are missing (:phab:`T409662`)
+ when mandatory packages are missing (:phab:`T409662`).
* Update `tools._unidata.__category_cf` dict for :func:`tools.chars.contains_invisible` and
- :func:`tools.chars.replace_invisible` to unicode version 17.0.0
-* Update Docker files to Python 3.12 (:phab:`T408997`)
+ :func:`tools.chars.replace_invisible` to unicode version 17.0.0.
+* Update Docker files to Python 3.12. (:phab:`T408997`)
**Bugfixes**
+* Remove invisible chars from :attr:`textlib.Section.heading`. (:phab:`T411307`)
+* Do not raise :exc:`exceptions.UnknownExtensionError` within
+ :meth:`APISite.page_from_repository()<pywikibot.site._apisite.APISite.page_from_repository>`
+ on non-Wikibase sites (:phab:`T414068`)
* Handle retry-after value gracefully if it is a float instead an int (:phab:`T414197`)
* Handle limit value gracefully if it is an int instead a str (:phab:`T414168`)
* Handle `lockmanager-fail-conflict` API error in :meth:`data.api.Request.submit` as retryable
@@ -90,6 +105,8 @@
**Other breaking changes**
+* Use global ``-code`` instead of ``-lang`` to determine a site.
+ The old ``-lang`` option is kept for backward compatibility.
* Protocol swapping in :class:`data.api.Request` was removed. Family files should provide
the correct protocol. (:phab:`T414369`)
* Package requirements were updated (``beautifulsoup4``, ``fake-useragent``, ``mwoauth``,
@@ -194,3 +211,9 @@
'millennium' must be used instead
* 10.0.0: *includeredirects* parameter of :func:`pagegenerators.AllpagesPageGenerator` and
:func:`pagegenerators.PrefixingPageGenerator` is deprecated and should be replaced by *filterredir*
+
+Pending removal in Pywikibot 14
+-------------------------------
+
+* Keyword parameters for *text_a* and *text_b* of :class:`diff.PatchManager` are deprecated.
+ Positional parameters for *by_letter* and *replace_invisible* are deprecated.
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index 72662fb..d5eb34d 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -12,6 +12,6 @@
from time import strftime
-__version__ = '11.0.0.dev10'
+__version__ = '11.0.0.dev11'
__url__ = 'https://www.mediawiki.org/wiki/Manual:Pywikibot'
__copyright__ = f'2003-{strftime("%Y")}, Pywikibot team'
diff --git a/scripts/CHANGELOG.rst b/scripts/CHANGELOG.rst
index b296544..03b2ad5 100644
--- a/scripts/CHANGELOG.rst
+++ b/scripts/CHANGELOG.rst
@@ -10,8 +10,15 @@
archivebot
^^^^^^^^^^
+* Also no longer search for an archiveheader template if it is already
+ given with the archive template. (:phab:`T414068`)
* respect the ``-namespace`` option with ``-page`` option (:phab:`T409016`)
+welcome
+^^^^^^^
+
+* Check whether the script is localized within WelcomeBot initializer. (:phab:`T414007`)
+
10.7.0
------
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1234364?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I36cd3897e29cf9c40ba5a5b8014ff4de6d8689f2
Gerrit-Change-Number: 1234364
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1224720?usp=email )
Change subject: ProofreadPage: Never use None as key in WeakKeyDictionary
......................................................................
ProofreadPage: Never use None as key in WeakKeyDictionary
Bug: T413563
Change-Id: Iffa326896906f757278a7e83f803a38c136f213d
---
M pywikibot/proofreadpage.py
1 file changed, 26 insertions(+), 0 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index 92ce8a9..dbece5b 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -168,7 +168,15 @@
"""A descriptor tag.
+ Implements a data descriptor for attributes of <pages /> tags
+ (used in :class:`PagesTagParser`). Provides controlled access
+ to a single attribute value via a WeakKeyDictionary to store
+ per-instance da
+
.. versionadded:: 8.0
+ .. versionchanged:: 11.0
+ Never use None as key in WeakKeyDictionary. Class-level access
+ returns the descriptor itself.
"""
def __init__(self) -> None:
@@ -179,10 +187,27 @@
self.public_name = name
def __get__(self, obj, objtype=None):
+ """Retrieve the value of the attribute for a given instance.
+
+ .. versionchanged:: 11.0
+ If *obj* is None (e.g., when accessed via the class rather
+ than an instance), return the descriptor itself instead of
+ attempting to use None as a key in the WeakKeyDictionary.
+
+ :param obj: Instance of the class that owns this descriptor, or
+ None if accessed via the class.
+ :param objtype: Type of the class (unused).
+ :return: The attribute value for the instance, or the descriptor
+ itself if accessed via the class.
+ """
+ if obj is None:
+ return self
+
attr = self.attrs.get(obj)
return attr.value if attr is not None else None
def __set__(self, obj, value) -> None:
+ """Set attribute value for the given instance."""
attr = self.attrs.get(obj)
if attr is not None:
attr.value = value
@@ -190,6 +215,7 @@
self.attrs[obj] = TagAttr(self.public_name, value)
def __delete__(self, obj):
+ """Delete attribute for the given instance."""
self.attrs.pop(obj, None)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1224720?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iffa326896906f757278a7e83f803a38c136f213d
Gerrit-Change-Number: 1224720
Gerrit-PatchSet: 5
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
Attention is currently required from: PywikibotCommitWatcher.
AtharvaKathe has posted comments on this change by AtharvaKathe. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1230405?usp=email )
Change subject: Fix: validate 'start' parameter in parse_start and raise ValueError on invalid formats
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Hi! Could I get a review on this patch? It adds stricter validation for the parse_start() helper in logevents.
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1230405?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I4ef16fbcb7059bf137d47095564f508765e12ccf
Gerrit-Change-Number: 1230405
Gerrit-PatchSet: 1
Gerrit-Owner: AtharvaKathe <atharvakathe567(a)gmail.com>
Gerrit-Reviewer: AtharvaKathe <atharvakathe567(a)gmail.com>
Gerrit-Reviewer: PywikibotCommitWatcher <pywikibot-commits(a)lists.wikimedia.org>
Gerrit-Attention: PywikibotCommitWatcher <pywikibot-commits(a)lists.wikimedia.org>
Gerrit-Comment-Date: Thu, 22 Jan 2026 19:01:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: PywikibotCommitWatcher.
Hello PywikibotCommitWatcher,
I'd like you to do a code review.
Please visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1230405?usp=email
to review the following change.
Change subject: Fix: validate 'start' parameter in parse_start and raise ValueError on invalid formats
......................................................................
Fix: validate 'start' parameter in parse_start and raise ValueError on invalid formats
Improved input handling in parse_start by detecting invalid timestamp
strings and raising a clear ValueError instead of silently converting them.
This matches expected behavior in LogeventsPageGenerator and ensures
better consistency with test expectations.
Change-Id: I4ef16fbcb7059bf137d47095564f508765e12ccf
---
M pywikibot/pagegenerators/_factory.py
1 file changed, 13 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/05/1230405/1
diff --git a/pywikibot/pagegenerators/_factory.py b/pywikibot/pagegenerators/_factory.py
index 22d5201..bcd1dfa 100644
--- a/pywikibot/pagegenerators/_factory.py
+++ b/pywikibot/pagegenerators/_factory.py
@@ -387,22 +387,24 @@
value.
"""
def parse_start(
- start: str | None
- ) -> tuple[pywikibot.Timestamp | None, int | None]:
+ start: str | None,
+ ) -> tuple[Optional[pywikibot.Timestamp], Optional[int]]:
"""Parse start and return (start, total)."""
if not start:
return None, None
- if len(start) >= 8:
- return pywikibot.Timestamp.fromtimestampformat(start), None
+ # If start looks like timestamp → treat as timestamp
+ if len(start) >= 8 and start.isdigit():
+ try:
+ return pywikibot.Timestamp.fromtimestampformat(start), None
+ except Exception as err:
+ raise ValueError(f"Invalid timestamp format: {err}") from err
- instead = (f'-limit option like "-logevents:{logtype}'
- f'{"," if user else ""}{user} -limit:{start}"')
- issue_deprecation_warning('-logevents with total argument',
- instead,
- warning_class=ArgumentDeprecationWarning,
- since='9.2.0')
- return None, int(start)
+ # If NOT timestamp → treat as total number
+ if start.isdigit():
+ return None, int(start)
+
+ raise ValueError("Start must be timestamp (>=8 digits) or a positive integer.")
try:
start_, total = parse_start(start)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1230405?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I4ef16fbcb7059bf137d47095564f508765e12ccf
Gerrit-Change-Number: 1230405
Gerrit-PatchSet: 1
Gerrit-Owner: AtharvaKathe <atharvakathe567(a)gmail.com>
Gerrit-Reviewer: AtharvaKathe <atharvakathe567(a)gmail.com>
Gerrit-Reviewer: PywikibotCommitWatcher <pywikibot-commits(a)lists.wikimedia.org>
Gerrit-Attention: PywikibotCommitWatcher <pywikibot-commits(a)lists.wikimedia.org>
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1228281?usp=email )
Change subject: Optimize SubCategoriesPageGenerator (fix error too many requests)
......................................................................
Optimize SubCategoriesPageGenerator (fix error too many requests)
Change-Id: I3f3f4a721799ffaffaac455f2b674b74e3f618e5
---
M pywikibot/pagegenerators/_generators.py
1 file changed, 3 insertions(+), 5 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/pagegenerators/_generators.py b/pywikibot/pagegenerators/_generators.py
index 1b76e1d..2579492 100644
--- a/pywikibot/pagegenerators/_generators.py
+++ b/pywikibot/pagegenerators/_generators.py
@@ -378,11 +378,9 @@
:param content: If True, retrieve the content of the current version
of each page (default False)
"""
- # TODO: page generator could be modified to use cmstartsortkey ...
- for s in category.subcategories(recurse=recurse,
- total=total, content=content):
- if start is None or s.title(with_ns=False) >= start:
- yield s
+ return category.subcategories(recurse=recurse,
+ total=total, content=content,
+ startprefix=start)
def LinkedPageGenerator(
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1228281?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I3f3f4a721799ffaffaac455f2b674b74e3f618e5
Gerrit-Change-Number: 1228281
Gerrit-PatchSet: 3
Gerrit-Owner: Louperivois <plmoell(a)hotmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1225619?usp=email )
Change subject: get_delay: consider retry_after in delay calculation
......................................................................
get_delay: consider retry_after in delay calculation
Include any pending retry_after when computing the delay for read or
write operations. The returned value still incorporates process
concurrency via process_multiplicity.
Bug: T414354
Change-Id: I06e863e35cb8087b493b74bd7d7cdf958a8572f2
---
M pywikibot/throttle.py
1 file changed, 15 insertions(+), 7 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index 0fe30ad..d0fd51f 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -10,7 +10,7 @@
on the number of concurrent bot instances, and optional lag-aware delays.
"""
#
-# (C) Pywikibot team, 2008-2025
+# (C) Pywikibot team, 2008-2026
#
# Distributed under the terms of the MIT license.
#
@@ -269,25 +269,33 @@
def get_delay(self, *, write: bool = False) -> float:
"""Return the current delay, adjusted for active processes.
- Compute the delay for a read or write operation, factoring in
- process concurrency. This method does not account for how much
- time has already passed since the last access — use
+ Computes the delay for a read or write operation, taking into
+ account process concurrency and any pending retry-after value.
+ The returned value already includes the
+ :attr:`process_multiplicity` factor. This method does not
+ consider how much time has passed since the last access — use
:meth:`waittime` for that.
.. versionadded:: 10.3.0
Renamed from :meth:`getDelay`.
+ .. versionchanged:: 11.0
+ The delay now takes any pending :attr:`retry_after` into
+ account.
:param write: Whether the operation is a write (uses writedelay).
:return: The delay in seconds before the next operation should
occur.
"""
- current_delay = self.writedelay if write else self.delay
-
# Refresh process count if the check interval has elapsed
if time.time() > self.checktime + self.checkdelay:
self.checkMultiplicity()
- current_delay = max(self.mindelay, min(current_delay, self.maxdelay))
+ current_delay = max(
+ self.mindelay,
+ self.retry_after,
+ min(self.writedelay if write else self.delay, self.maxdelay)
+ )
+
return current_delay * self.process_multiplicity
def waittime(self, write: bool = False):
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1225619?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I06e863e35cb8087b493b74bd7d7cdf958a8572f2
Gerrit-Change-Number: 1225619
Gerrit-PatchSet: 10
Gerrit-Owner: Shivaansh Singh <shivaanshsingh293(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1228280?usp=email )
Change subject: doc: Update documentation for api.Request
......................................................................
doc: Update documentation for api.Request
This is a follow-up patch for I1234567890abcdef1234567890abcdef12345678
Bug: T414369
Change-Id: I0709d0a18f1f18867d97cbf48f87e2762fe0ed10
---
M pywikibot/data/api/_requests.py
1 file changed, 9 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py
index fe20032..7891757 100644
--- a/pywikibot/data/api/_requests.py
+++ b/pywikibot/data/api/_requests.py
@@ -706,6 +706,10 @@
content.
.. versionchanged:: 9.2
no wait cycles for :exc:`ImportError` and :exc:`NameError`.
+ .. versionchanged:: 11.0
+ The scheme swapping introduced in version 8.2 was removed.
+ Any :class:`Family<family.Family>` file must provide a
+ correct :meth:`protocol()<family.Family.protocol>` method.
:param use_get: If True, send a GET request; otherwise send POST.
:param uri: The URI path to request on the site.
@@ -773,8 +777,11 @@
"""Return a dict from requests.Response.
.. versionchanged:: 8.2
- show a warning to add a ``protocol()`` method to the family
- file if suitable.
+ show a warning to add a :meth:`protocol()
+ <family.Family.protocol>` method to the family file if suitable.
+ .. versionchanged:: 11.0
+ The warning about missing or wrong ``protocol()`` method
+ introduced in version 8.2 was removed.
:param response: a requests.Response object
:type response: requests.Response
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1228280?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I0709d0a18f1f18867d97cbf48f87e2762fe0ed10
Gerrit-Change-Number: 1228280
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot