Modify log message when checking file permissions

Removed code to display it in octal since it makes no sense on Windows.
Added `oct()` around linux permissions when expected_permissions is
being defined.
This commit is contained in:
shreyamalviya 2021-06-09 19:44:35 +05:30
parent 424aceb116
commit 91aad66e16
1 changed files with 2 additions and 2 deletions

View File

@ -26,9 +26,9 @@ def _raise_if_incorrect_permissions(
f: str, linux_expected_permissions: int, windows_expected_permissions: int
):
expected_permissions = (
windows_expected_permissions if is_windows_os() else linux_expected_permissions
windows_expected_permissions if is_windows_os() else oct(linux_expected_permissions)
)
if not has_expected_permissions(f, expected_permissions):
raise InsecurePermissionsError(
f"The file {f} has incorrect permissions. Expected: {oct(expected_permissions)}"
f"The file {f} has incorrect permissions. Expected: {expected_permissions}"
)