jenkins-bot submitted this change.

View Change


Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
[bugfix] Do not pass None to Timestamp.fromtimestampformat()

Bug: T354281
Change-Id: I1e612266e0f5b7b6a55cc99eb56e72bca3861261
---
M pywikibot/pagegenerators/_factory.py
1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/pywikibot/pagegenerators/_factory.py b/pywikibot/pagegenerators/_factory.py
index 80c8081..4de0b08 100644
--- a/pywikibot/pagegenerators/_factory.py
+++ b/pywikibot/pagegenerators/_factory.py
@@ -1,6 +1,6 @@
"""GeneratorFactory module wich handles pagegenerators options."""
#
-# (C) Pywikibot team, 2008-2023
+# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
#
@@ -413,14 +413,13 @@
'positive int.'.format(start))
return None

- try:
- end = pywikibot.Timestamp.fromtimestampformat(end)
- except ValueError as err:
- pywikibot.error(
- f'{err}. End parameter has wrong format!')
- return None
- except TypeError: # end is None
- pass
+ if end is not None:
+ try:
+ end = pywikibot.Timestamp.fromtimestampformat(end)
+ except ValueError as err:
+ pywikibot.error(
+ f'{err}. End parameter has wrong format!')
+ return None

if start or end:
pywikibot.info('Fetching log events in range: {} - {}.'

To view, visit change 987433. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1e612266e0f5b7b6a55cc99eb56e72bca3861261
Gerrit-Change-Number: 987433
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Mpaa <mpaa.wiki@gmail.com>
Gerrit-MessageType: merged