jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1015994?usp=email )

Change subject: [fix] file title must have a valid file extension
......................................................................

[fix] file title must have a valid file extension

An invalid file extension will lead to a ValueError.
Skip the current file or retry to enter a valid filename.

Bug: T345786
Change-Id: Ie95c837156d893e2e8faa6eaac96fc95a63531a8
---
M pywikibot/specialbots/_upload.py
1 file changed, 20 insertions(+), 7 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/pywikibot/specialbots/_upload.py b/pywikibot/specialbots/_upload.py
index ce8bd29..0aad35d 100644
--- a/pywikibot/specialbots/_upload.py
+++ b/pywikibot/specialbots/_upload.py
@@ -3,7 +3,7 @@
 Do not import classes directly from here but from specialbots.
 """
 #
-# (C) Pywikibot team, 2003-2023
+# (C) Pywikibot team, 2003-2024
 #
 # Distributed under the terms of the MIT license.
 #
@@ -270,13 +270,13 @@
                 if self.opt.always:
                     pywikibot.info('File format is not one of [{}]'
                                    .format(' '.join(allowed_formats)))
-                    continue

-                if not pywikibot.input_yn(
-                        'File format is not one of [{}], but {!r}. Continue?'
-                        .format(' '.join(allowed_formats), ext),
-                        default=False):
-                    continue
+                elif pywikibot.input_yn(
+                        'File format is not one of [{}], but {!r}. Skip?'
+                        .format(' '.join(allowed_formats), ext)):
+                    return None
+
+                continue

             potential_file_page = pywikibot.FilePage(self.target_site,
                                                      filename)

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1015994?usp=email
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: Ie95c837156d893e2e8faa6eaac96fc95a63531a8
Gerrit-Change-Number: 1015994
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to