You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed because my usual shell prompt in $PS1 has "\u" in it to show my username, the presence of "\u" in any environment variable causes arouteserver to fail like this:
$ export FOO='\u'
$ arouteserver show_config
ARouteServer 2019-10-06 17:39:04,919 ERROR An unexpected error occurred: bad escape \u at position 0
Please consider reporting this issue to the author using the URL below, including the following traceback and some hints on how to reproduce it: https://github.com/pierky/arouteserver/issues
Traceback (most recent call last):
File "/usr/local/lib/python3.7/sre_parse.py", line 1021, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\\u'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/arouteserver", line 64, in <module>
if main():
File "/usr/local/bin/arouteserver", line 53, in main
return cmd.run()
File "/usr/local/lib/python3.7/site-packages/pierky/arouteserver/commands/show_config.py", line 46, in run
self.show_config(current_config_path, sys.stdout)
File "/usr/local/lib/python3.7/site-packages/pierky/arouteserver/commands/show_config.py", line 70, in show_config
distrib._load_from_yaml("cfg:\n"
File "/usr/local/lib/python3.7/site-packages/pierky/arouteserver/config/base.py", line 87, in _load_from_yaml
expanded_doc = expand_env_vars(expanded_doc)
File "/usr/local/lib/python3.7/site-packages/pierky/arouteserver/config/base.py", line 81, in expand_env_vars
res = re.sub("\$\{" + v + "\}", os.environ[v], res)
File "/usr/local/lib/python3.7/re.py", line 192, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "/usr/local/lib/python3.7/re.py", line 309, in _subx
template = _compile_repl(template, pattern)
File "/usr/local/lib/python3.7/re.py", line 300, in _compile_repl
return sre_parse.parse_template(repl, pattern)
File "/usr/local/lib/python3.7/sre_parse.py", line 1024, in parse_template
raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \u at position 0
The text was updated successfully, but these errors were encountered:
I've just pushed a fix, it's in the "dev" branch now, but also a CI/CD pipeline is running https://travis-ci.org/pierky/arouteserver/builds/594270338 and if everything will work as expected, a pre-release (v0.22.2-alpha1 ) will be pushed to the PyPi testing environment.
The PyPi file has not been pushed yet because of some integration tests are failing on CentOS, but it's not related to this hot fix, it's just a matter of tuning the tests for the latest version 8, which has been released only recently.
Hopefully the pipeline should work now, and the pre-release should go out. After that, I'll push it upstream to master, hopefully tomorrow.
Noticed because my usual shell prompt in $PS1 has "\u" in it to show my username, the presence of "\u" in any environment variable causes arouteserver to fail like this:
The text was updated successfully, but these errors were encountered: