diff --git a/src/aiida/orm/nodes/data/code/installed.py b/src/aiida/orm/nodes/data/code/installed.py index 31191377f9..ad05fd45b0 100644 --- a/src/aiida/orm/nodes/data/code/installed.py +++ b/src/aiida/orm/nodes/data/code/installed.py @@ -139,10 +139,8 @@ def validate_filepath_executable(self): file_exists = transport.isfile(str(self.filepath_executable)) if file_exists: mode = transport.get_mode(str(self.filepath_executable)) - # Shift right to get the user permission bits - user_permissions = mode >> 6 - # Check if the execute bit is set - user_has_execute = (user_permissions & 1) != 0 + # check if execute but is set + user_has_execute = format(mode, "b")[6] == '1' except Exception as exception: raise exceptions.ValidationError(