### Summary

Problem detected on community.grafana collection.
The CI fails because of the following error:
```
ERROR: Ansible could not initialize the preferred locale: unsupported locale setting
```

[Link to the github actions logs](https://github.com/ansible-collections/community.grafana/runs/7376131642?check_suite_focus=true).

Edit: I edited my workflow to let all the job run and disable fail-fast. It makes it visible that issue only happens on devel:
https://github.com/ansible-collections/community.grafana/runs/7376236257?check_suite_focus=true

### Issue Type

Bug Report

### Component Name

core ?

### Ansible Version

```console
devel

(`pip install https://github.com/ansible/ansible/archive/devel.tar.gz`)
```


### Configuration

```console
N/A
```


### OS / Environment

ubuntu 20.04.4

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
On `community.grafana` collection
```yaml (paste below)
ansible-test integration -v --color --retry-on-error --requirements --python 3.8 --continue-on-error --diff --coverage
```



### Expected Results

No error related to locale.

### Actual Results

```console
ERROR: Ansible could not initialize the preferred locale: unsupported locale setting
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
"""Parse lines from the given value using the specified pattern and return the extracted list of key/value pair dictionaries."""
    matched = []
    unmatched = []
    for line in value.splitlines():
        match = re.search(pattern, line)
        if match:
            matched.append(match.groupdict())
        else:
            unmatched.append(line)
    if unmatched:
        raise Exception('Pattern "%s" did not match values:\n%s' % (pattern, '\n'.join(unmatched)))
    return matched
def get_subclasses(class_type):  
    """Returns a list of types that are concrete subclasses of the given type."""
    subclasses = set()  
    queue = [class_type]  
    while queue:
        parent = queue.pop()
        for child in parent.__subclasses__():
            if child not in subclasses:
                if not inspect.isabstract(child):
                    subclasses.add(child)
                queue.append(child)
    return sorted(subclasses, key=lambda sc: sc.__name__)
def is_subdir(candidate_path, path):