Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/876353 )
Change subject: [doc] Update ROADMAP.rst and HISTORY.rst
......................................................................
[doc] Update ROADMAP.rst and HISTORY.rst
Change-Id: Ifa1e0cd388aa0d7a1854f4d16faffd927c7569e6
---
M ROADMAP.rst
M HISTORY.rst
2 files changed, 20 insertions(+), 0 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/HISTORY.rst b/HISTORY.rst
index 694c539..dfa92df 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,6 +1,13 @@
Release history
===============
+7.7.3
+-----
+*08 January 2023*
+
+* Add support for shn-wikibooks, as quote, guw quote, got-wikt families
+ (:phab:`T148280`, :phab:`T326141`, :phab:`T321285`, :phab:`T321297`)
+
7.7.2
-----
*03 December 2022*
diff --git a/ROADMAP.rst b/ROADMAP.rst
index e184105..31eba69 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -4,6 +4,8 @@
Improvements
^^^^^^^^^^^^
+* Support federated Wikibase (:phab:`T173195`)
+* Improve warning if a Non-JSON response was received from server (:phab:`T326046`)
* Allow normalization of :class:`pywikibot.WbTime` objects (:phab:`T123888`)
* Add parser for ``<pages />`` tag to :mod:`proofreadpage`
* ``addOnly`` parameter of :func:`textlib.replaceLanguageLinks` and :func:`textlib.replaceCategoryLinks`
@@ -50,6 +52,8 @@
Bugfixes
^^^^^^^^
+* Don't raise StopIteration in :meth:`login.LoginManager.check_user_exists`
+ if given user is behind the last user (:phab:`T326063`)
* Normalize :class:`WbTimes<pywikibot.WbTime>` sent to Wikidata (:phab:`T325860`)
* Fix :class:`pywikibot.WbTime` precision (:phab:`T324798`)
* Unquote title for red-links in class:`proofreadpage.IndexPage`
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/876353
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: Ifa1e0cd388aa0d7a1854f4d16faffd927c7569e6
Gerrit-Change-Number: 876353
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/+/874023 )
Change subject: [bugfix] Use a default result for allusers() if next() leads to StopIteration
......................................................................
[bugfix] Use a default result for allusers() if next() leads to StopIteration
- use a default result for allusers() if next() leads to StopIteration
- catch the NoUsernameError exception in login.py script and only
show the exception message instead of raising it
- fix error messages handling
Bug: T326063
Change-Id: Ia41bc9d80fcfd2e9e88542201236ceab87c6508c
---
M pywikibot/login.py
M pywikibot/scripts/login.py
2 files changed, 28 insertions(+), 9 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/login.py b/pywikibot/login.py
index 1b1b661..e284b98 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -1,6 +1,6 @@
"""Library to log the bot in to a wiki account."""
#
-# (C) Pywikibot team, 2003-2022
+# (C) Pywikibot team, 2003-2023
#
# Distributed under the terms of the MIT license.
#
@@ -133,7 +133,7 @@
try:
data = self.site.allusers(start=main_username, total=1)
- user = next(data)
+ user = next(data, {'name': None})
except APIError as e:
if e.code == 'readapidenied':
pywikibot.warning("Could not check user '{}' exists on {}"
@@ -294,15 +294,16 @@
self.login_to_site()
except APIError as e:
error_code = e.code
- pywikibot.error(f'Login failed ({error_code}).')
+
+ # TODO: investigate other unhandled API codes
if error_code in self._api_error:
- error_msg = 'Username "{}" {} on {}'.format(
+ error_msg = 'Username {!r} {} on {}'.format(
self.login_name, self._api_error[error_code], self.site)
if error_code in ('Failed', 'FAIL'):
- error_msg += f'\n.{e.info}'
+ error_msg += f'.\n{e.info}'
raise NoUsernameError(error_msg)
- # TODO: investigate other unhandled API codes (bug T75539)
+ pywikibot.error(f'Login failed ({error_code}).')
if retry:
self.password = None
return self.login(retry=False)
diff --git a/pywikibot/scripts/login.py b/pywikibot/scripts/login.py
index f47bc20..cbdd9a2 100755
--- a/pywikibot/scripts/login.py
+++ b/pywikibot/scripts/login.py
@@ -47,7 +47,7 @@
moved to :mod:`pywikibot.scripts` folder
"""
#
-# (C) Pywikibot team, 2003-2022
+# (C) Pywikibot team, 2003-2023
#
# Distributed under the terms of the MIT license.
#
@@ -58,7 +58,7 @@
import pywikibot
from pywikibot import config
from pywikibot.backports import Tuple, nullcontext
-from pywikibot.exceptions import SiteDefinitionError
+from pywikibot.exceptions import NoUsernameError, SiteDefinitionError
from pywikibot.login import OauthLoginManager
@@ -109,7 +109,10 @@
if logout:
site.logout()
else:
- site.login(autocreate=autocreate)
+ try:
+ site.login(autocreate=autocreate)
+ except NoUsernameError as e:
+ pywikibot.error(e)
user = site.user()
if user:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/874023
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: Ia41bc9d80fcfd2e9e88542201236ceab87c6508c
Gerrit-Change-Number: 874023
Gerrit-PatchSet: 4
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/+/876312 )
Change subject: [doc] Add deprecation of 'cosmetic_changes-append' to ROADMAP.rst
......................................................................
[doc] Add deprecation of 'cosmetic_changes-append' to ROADMAP.rst
'cosmetic_changes-append' were restored but the are still deprecated;
But Pywikibot 7 still needs these messages due to a twtranslation()
bug.
Bug: T326470
Change-Id: Idbe860d64dcaebb6fc367992c5467c78cc6f6224
---
M ROADMAP.rst
1 file changed, 15 insertions(+), 0 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 59ae273..e184105 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -119,6 +119,7 @@
* 7.0.0: A boolean watch parameter in Page.save() is deprecated and will be desupported
* 7.0.0: baserevid parameter of editSource(), editQualifier(), removeClaims(), removeSources(), remove_qualifiers() DataSite methods will be removed
* 7.0.0: Values of APISite.allpages() parameter filterredir other than True, False and None are deprecated
+* 7.0.0: The i18n identifier 'cosmetic_changes-append' will be removed in favour of 'pywikibot-cosmetic-changes'
* 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
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/876312
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: Idbe860d64dcaebb6fc367992c5467c78cc6f6224
Gerrit-Change-Number: 876312
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged