The re module doesn't seem to like Python 3.7. This error happens on the most simple @app.route('/example').
python proxy.py
Traceback (most recent call last):
File "/Users/grantmurphy/.local/share/virtualenvs/elastic_proxy-jpNTIbJ1/lib/python3.7/sre_parse.py", line 1021, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\\d'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "proxy.py", line 22, in <module>
@app.route(u'/sitemap')
File "/Users/grantmurphy/.local/share/virtualenvs/elastic_proxy-jpNTIbJ1/lib/python3.7/site-packages/weppy/expose.py", line 188, in __call__
routeobj = Route(self, path, idx)
File "/Users/grantmurphy/.local/share/virtualenvs/elastic_proxy-jpNTIbJ1/lib/python3.7/site-packages/weppy/expose.py", line 295, in __init__
self.schemes, self.hostname, self.methods, self.path)
File "/Users/grantmurphy/.local/share/virtualenvs/elastic_proxy-jpNTIbJ1/lib/python3.7/site-packages/weppy/expose.py", line 115, in build_regex
path = cls.REGEX_INT.sub('(?P<\g<1>>\d+)', path)
File "/Users/grantmurphy/.local/share/virtualenvs/elastic_proxy-jpNTIbJ1/lib/python3.7/re.py", line 309, in _subx
template = _compile_repl(template, pattern)
File "/Users/grantmurphy/.local/share/virtualenvs/elastic_proxy-jpNTIbJ1/lib/python3.7/re.py", line 300, in _compile_repl
return sre_parse.parse_template(repl, pattern)
File "/Users/grantmurphy/.local/share/virtualenvs/elastic_proxy-jpNTIbJ1/lib/python3.7/sre_parse.py", line 1024, in parse_template
raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \d at position 10
(elastic_proxy-jpNTIbJ1)
Managed to fix this by:
pip install regex
Adding import regex as re to the weppy/expose.py
There's more than likely a 'more correct' fix for this.
The re module doesn't seem to like Python 3.7. This error happens on the most simple
@app.route('/example')
.Managed to fix this by:
import regex as re
to the weppy/expose.pyThere's more than likely a 'more correct' fix for this.