jenkins-bot has submitted this change and it was merged.
Change subject: [bugfix] omit mode 600 warning for non-unix platforms ......................................................................
[bugfix] omit mode 600 warning for non-unix platforms
- mode 600 is availlable for unix platforms only. Therefor re-read the changes and inform the user.
Bug: T144157 Change-Id: I1bfac31cee201dbfe5b595fb7606663ec13f54f4 --- M pywikibot/comms/http.py 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 9fc29ae..0f6e083 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -84,7 +84,9 @@ st_mode = os.stat(filename).st_mode if stat.S_ISREG(st_mode) and (st_mode - stat.S_IFREG != mode_600): os.chmod(filename, mode_600) - pywikibot.warning(warn_str.format(filename, mode_600)) + # re-read and check changes + if os.stat(filename).st_mode != st_mode: + pywikibot.warning(warn_str.format(filename, mode_600))
def mode_check_decorator(func):