ansigenome config fails with non ASCII characters
Closed this issue · 2 comments
scibi commented
I've installed ansigenome
in virtual env running Python 2.7.3. After running ansigenome config
I got following traceback:
Traceback (most recent call last):
File "/home/scibi/.virtualenvs/ansible_xxxxx/bin/ansigenome", line 326, in <module>
main()
File "/home/scibi/.virtualenvs/ansible_xxxxx/bin/ansigenome", line 309, in main
(config, config_path) = load_config()
File "/home/scibi/.virtualenvs/ansible_xxxxx/bin/ansigenome", line 248, in load_config
Config([], {}, {})
File "/home/scibi/.virtualenvs/ansible_xxxxx/local/lib/python2.7/site-packages/ansigenome/config.py", line 29, in __init__
utils.write_config(self.config_path, out_config)
File "/home/scibi/.virtualenvs/ansible_xxxxx/local/lib/python2.7/site-packages/ansigenome/utils.py", line 398, in write_config
string_to_file(path, config_as_string)
File "/home/scibi/.virtualenvs/ansible_xxxxx/local/lib/python2.7/site-packages/ansigenome/utils.py", line 50, in string_to_file
file.write(input)
File "/home/scibi/.virtualenvs/ansible_xxxxx/lib/python2.7/codecs.py", line 691, in write
return self.writer.write(data)
File "/home/scibi/.virtualenvs/ansible_xxxxx/lib/python2.7/codecs.py", line 351, in write
data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 81: ordinal not in range(128)
The cause of that was letter 'Ś' in my name. Replacing it with 'S' "solved" the issue.