### Summary

ansible-playbook with --connection-password-file or --become-password-file  options fails  with error:

 File "venv/lib/python3.8/site-packages/ansible/cli/__init__.py", line 516, in get_password_from_file
    elif os.path.is_executable(b_pwd_file):
AttributeError: module 'posixpath' has no attribute 'is_executable'


### Issue Type

Bug Report

### Component Name

https://github.com/ansible/ansible/blob/devel/lib/ansible/cli/__init__.py#L543

### Ansible Version

```console
ansible [core 2.12.1]
  config file = ***/ansible/ansible.cfg
  configured module search path = ['.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = ***/ansible/venv/lib/python3.8/site-packages/ansible
  ansible collection location = .ansible/collections:/usr/share/ansible/collections
  executable location = ***/ansible/venv/bin/ansible
  python version = 3.8.6 (default, Nov 20 2020, 18:02:11) [Clang 11.0.0 (clang-1100.0.33.17)]
  jinja version = 2.11.1
  libyaml = False
```


### Configuration

```console
HOST_KEY_CHECKING=False
```


### OS / Environment

Mac OS 11.6.1

### Steps to Reproduce

1. Implement simple playbook ping.yml:
````yaml
- hosts: all
  become: true
  tasks:
  - ping
````
2. Run command ````ansible-playbook -i hosts ping.yml --connection-password-file file````
3. Error occurs

### Expected Results

I expect ansible-playbook command to load password from file.

### Actual Results

```console
ERROR! Unexpected Exception, this is probably a bug: module 'posixpath' has no attribute 'is_executable'
the full traceback was:

Traceback (most recent call last):
  File "***/ansible/venv/bin/ansible-playbook", line 128, in <module>
    exit_code = cli.run()
  File "***/ansible/venv/lib/python3.8/site-packages/ansible/cli/playbook.py", line 114, in run
    (sshpass, becomepass) = self.ask_passwords()
  File "***/ansible/venv/lib/python3.8/site-packages/ansible/cli/__init__.py", line 257, in ask_passwords
    sshpass = CLI.get_password_from_file(op['connection_password_file'])
  File "***/ansible/venv/lib/python3.8/site-packages/ansible/cli/__init__.py", line 516, in get_password_from_file
    elif os.path.is_executable(b_pwd_file):
AttributeError: module 'posixpath' has no attribute 'is_executable'
(venv) ➜  ansible git:(PML-4558-lv-qa-prod-ansible) ✗ ansible --version
ansible [core 2.12.1]
  config file = ***/ansible/ansible.cfg
  configured module search path = ['***/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = ***/ansible/venv/lib/python3.8/site-packages/ansible
  ansible collection location = ***/.ansible/collections:/usr/share/ansible/collections
  executable location = ***/ansible/venv/bin/ansible
  python version = 3.8.6 (default, Nov 20 2020, 18:02:11) [Clang 11.0.0 (clang-1100.0.33.17)]
  jinja version = 2.11.1
  libyaml = False
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
no_hosts = False
        if len(inventory.list_hosts()) == 0:
            
            if C.LOCALHOST_WARNING and pattern not in C.LOCALHOST:
                display.warning("provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'")
            no_hosts = True
        inventory.subset(subset)
        hosts = inventory.list_hosts(pattern)
        if not hosts and no_hosts is False:
            raise AnsibleError("Specified hosts and/or --limit does not match any hosts")
        return hosts
    @staticmethod
    def get_password_from_file(pwd_file):
        b_pwd_file = to_bytes(pwd_file)
        secret = None
        if b_pwd_file == b'-':
            
            secret = sys.stdin.buffer.read()
        elif not os.path.exists(b_pwd_file):