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

Task failed with unicode characters in /etc/environment on target host #600

tho86 opened this issue Jul 19, 2019 · 1 comment


Copy link

commented Jul 19, 2019

  • Which version of Ansible are you running? 2.7.7

  • Are you running with any custom modules, or module_utils loaded? mitogen 0.2.7

  • Have you tried the latest master version from Git? We'll try 0.2.6 and 0.2.7

Ansible server : debian 9.6
Target host : debian 9.8
python 2.7 is used on ansible server and target host.

CallError: exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 25: ordinal not in range(128)
File "", line 3099, in _dispatch_one
File "", line 3086, in _parse_request
File "", line 596, in import_module
File "", line 1357, in load_module
File "", line 1, in
File "master:/data/mitogen-0.2.7/ansible_mitogen/", line 85, in
import ansible_mitogen.runner
File "", line 1357, in load_module
File "", line 1, in
File "master:/data/mitogen-0.2.7/ansible_mitogen/", line 219, in
_etc_env_watcher = EnvironmentFileWatcher('/etc/environment')
File "master:/data/mitogen-0.2.7/ansible_mitogen/", line 134, in init
self._keys = [key for key, value in self._load()
File "master:/data/mitogen-0.2.7/ansible_mitogen/", line 151, in _load
return list(self._parse(fp))
File "master:/data/mitogen-0.2.7/ansible_mitogen/", line 163, in _parse
bits = shlex_split(line, comments=True)
File "master:/data/mitogen-0.2.7/ansible_mitogen/", line 112, in shlex_split
for token in shlex.split(str(s), comments=comments)]

With non unicode characters in /etc/environment its working well

dw added a commit that referenced this issue Aug 1, 2019

Merge remote-tracking branch 'origin/unienv'
* origin/unienv:
  docs: update Changelog.
  issue #600: /etc/environment may be non-ASCII in an unknown encoding
  docs: finished Changelog locking note
  Fix for sample in doc
  docs: break out and fix API use.

This comment has been minimized.

Copy link

commented Aug 1, 2019

This is now on the master branch and will make it into the next release. To be updated when a new release is made, subscribe to

Thanks for reporting this!

@dw dw closed this Aug 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.