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

Change subject: clean_sandbox: Fix textfile error reporting
......................................................................

clean_sandbox: Fix textfile error reporting

Use the parsed textfile option in the OSError handler.

The filename is kept outside the bot options, so indexing opts masks the file 
error.

Change-Id: I82528cfb251d3378f271f12b82bce415f2e4ba6e
---
M scripts/clean_sandbox.py
1 file changed, 1 insertion(+), 1 deletion(-)

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




diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index faaeb17..9a210a5 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -345,7 +345,7 @@
             with open(textfile_opt, encoding='utf-8') as textfile:
                 opts['text'] = textfile.read()
         except OSError as e:
-            pywikibot.error(f'Error loading {opts["textfile"]}: {e}')
+            pywikibot.error(f'Error loading {textfile_opt}: {e}')
             return

     generator = gen_factory.getCombinedGenerator()

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

Reply via email to