Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure --version works with non-ascii project path #66624

Merged
merged 1 commit into from May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/66617-version-unicode-fix.yml
@@ -0,0 +1,2 @@
bugfixes:
- Ensure that ``--version`` works with non-ascii ansible project paths (https://github.com/ansible/ansible/issues/66617)
2 changes: 1 addition & 1 deletion lib/ansible/config/manager.py
Expand Up @@ -231,7 +231,7 @@ def find_ini_config_file(warnings=None):
if os.path.exists(cwd_cfg):
warn_cmd_public = True
else:
potential_paths.append(cwd_cfg)
potential_paths.append(to_text(cwd_cfg, errors='surrogate_or_strict'))
except OSError:
# If we can't access cwd, we'll simply skip it as a possible config source
pass
Expand Down
@@ -0,0 +1,2 @@
[defaults]
library=~/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:.
6 changes: 6 additions & 0 deletions test/integration/targets/unicode/runme.sh
Expand Up @@ -5,3 +5,9 @@ set -eux
ansible-playbook unicode.yml -i inventory -v -e 'extra_var=café' "$@"
# Test the start-at-task flag #9571
ANSIBLE_HOST_PATTERN_MISMATCH=warning ansible-playbook unicode.yml -i inventory -v --start-at-task '*¶' -e 'start_at_task=True' "$@"

# Test --version works with non-ascii ansible project paths #66617
# Unset these so values from the project dir are used
unset ANSIBLE_CONFIG
unset ANSIBLE_LIBRARY
pushd křížek-ansible-project && ansible --version; popd