jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/987433 )
Change subject: [bugfix] Do not pass None to Timestamp.fromtimestampformat() ......................................................................
[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(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
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: {} - {}.'