[MacPorts] #50975: sysutils/ansible @2.0.1.0.1 not working with unset locale
MacPorts
noreply at macports.org
Sun Mar 27 00:22:49 PDT 2016
#50975: sysutils/ansible @2.0.1.0.1 not working with unset locale
------------------------+---------------------------
Reporter: easieste@… | Owner: adfernandes@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.3.4
Keywords: | Port: ansible
------------------------+---------------------------
Not exactly a bug report; more like a WORKAROUND for others possibly
encountering this issue.
Invoking `ansible-playbook` from sysutils/ansible at 2.0.1.0.1 fails where
the previous version worked:
{{{
Traceback (most recent call last):
File "/opt/local/bin/ansible-playbook", line 110, in <module>
display.error("Unexpected Exception: %s" % to_unicode(e),
wrap_text=False)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/site-packages/ansible/utils/display.py", line 261, in error
self.display(new_msg, color='red', stderr=True)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/site-packages/ansible/utils/display.py", line 124, in display
msg2 = to_bytes(msg2, encoding=self._output_encoding(stderr=stderr))
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/site-packages/ansible/utils/unicode.py", line 208, in to_bytes
return obj.encode(encoding, errors)
LookupError: unknown encoding:
}}}
The culprit is an unset locale in my environment.
One may either specify a locale via the 'module_lang' variable in
{/opt/local/etc/ansible/ansible.cfg} or setting LANG in the invoking shell
{{{
export LANG=en_US.UTF-8
}}}
The upstream Ansible code should probably code defensively against unset
locale in their basic "display output to users" routines.
--
Ticket URL: <https://trac.macports.org/ticket/50975>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list