mirror of https://github.com/ansible/ansible.git
Make config files obey the utf-8 input rule
When we read files from disk we always want to read them as bytes and then convert them to text ourselves. This gives us greater control over what encodings are used, what to do in case of errors decoding the bytes to text, and better resilience against problems on both Python 2 and Python 3. If we left it up to Python to do this, on Python2, this could mean that config values end up as bytes (leading to tracebacks elsewhere in the code). In Python3, it could traceback if the user's locale did not match with the encoding of the ini file or config files could be decoded as the user's locale encoding instead of as utf-8.pull/41415/head
parent
30da71d880
commit
204fc7becf
Loading…
Reference in New Issue