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

Need to convert filenames to byte strings before using them in APIs #39424

Merged
merged 1 commit into from
Apr 28, 2018

Conversation

abadger
Copy link
Contributor

@abadger abadger commented Apr 27, 2018

Under a non-utf-8 locale (for instance, LC_ALL=C), passing a non-ascii
filename to many APIs will traceback. Fix that by explicitly converting
to byte strings before passing to external APIs.

May fix #27262

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/plugins/action/template.py

ANSIBLE VERSION
devel 2.5 earlier

@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 27, 2018
Under a non-utf-8 locale (for instance, LC_ALL=C), passing a non-ascii
filename to many APIs will traceback.  Fix that by explicitly converting
to byte strings before passing to external APIs.

May fix ansible#27262
@abadger abadger force-pushed the template-encoding-ascii-locale branch from 2ad11e3 to 81f3b4f Compare April 27, 2018 16:58
@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label Apr 27, 2018
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 27, 2018
@abadger
Copy link
Contributor Author

abadger commented Apr 28, 2018

Failures are related to httpbin.org which are known at the moment. Unrelated to this PR. Merging to devel

@abadger abadger merged commit 2976b65 into ansible:devel Apr 28, 2018
@abadger abadger deleted the template-encoding-ascii-locale branch April 28, 2018 15:56
@ansible ansible locked and limited conversation to collaborators Apr 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template module not accepting source that contains UTF8 characters
3 participants