c2cgeoportal
c2cgeoportal copied to clipboard
encoding error reading vars_xxxx.yaml
If a äöü (or other special) character in a list value of vars_mapbs.yaml file following error is displayed:
Traceback (most recent call last): File ".build/venv/bin/c2c-template", line 11, in <module> load_entry_point('c2c.template==1.4.1', 'console_scripts', 'c2c-template')() File "/home/svagap/mapbs2/.build/venv/local/lib/python2.7/site-packages/c2c/te mplate.py", line 178, in main used_vars, skip = format_walker(used_vars) File "/home/svagap/mapbs2/.build/venv/local/lib/python2.7/site-packages/c2c/te mplate.py", line 166, in format_walker current_formatted = format_walker(current_vars[key], current_path) File "/home/svagap/mapbs2/.build/venv/local/lib/python2.7/site-packages/c2c/te mplate.py", line 166, in format_walker current_formatted = format_walker(current_vars[key], current_path) File "/home/svagap/mapbs2/.build/venv/local/lib/python2.7/site-packages/c2c/te mplate.py", line 166, in format_walker current_formatted = format_walker(current_vars[key], current_path) File "/home/svagap/mapbs2/.build/venv/local/lib/python2.7/site-packages/c2c/te mplate.py", line 166, in format_walker current_formatted = format_walker(current_vars[key], current_path) File "/home/svagap/mapbs2/.build/venv/local/lib/python2.7/site-packages/c2c/te mplate.py", line 155, in format_walker for index, var in enumerate(current_vars) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 101 : ordinal not in range(128) CONST_Makefile:664: recipe for target '.build/c2ctemplate-cache.json' failed make: *** [.build/c2ctemplate-cache.json] Error 1
Working (No error, build runs):
vars:
Prop1: Value With äüä
KeyWithäöü: Value
But this is not working:
vars:
Prop1: [ä, ü]
nor
vars:
KeyWithäüö: [value1, value2]
nor
vars:
Prop1:
- Value with äüö
you can see in our ngeoconfig branch: var_mapbs.yaml Line 1877 to 1879 are fine, but 1880 - 1882 display error as well as 1883 - 1885 https://github.com/camptocamp/baselstadt_mapbs/blob/02e77f1e9cfa9c4100b9103cd668b76609848e02/vars_mapbs.yaml#L1880
This seems deprecated