Skip to content

Commit

Permalink
[bugfix] omit mode 600 warning for non-unix platforms
Browse files Browse the repository at this point in the history
- mode 600 is availlable for unix platforms only.
  Therefor re-read the changes and inform the user.

Bug: T144157
Change-Id: I1bfac31cee201dbfe5b595fb7606663ec13f54f4
  • Loading branch information
xqt committed Sep 3, 2016
1 parent cac2a99 commit 34abac3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pywikibot/comms/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def mode_check(filename):
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):
Expand Down

0 comments on commit 34abac3

Please sign in to comment.