-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An escape error of re.py (re.error: bad escape \s at position 0) in "utils/logloader.py" based on Python3.7 #50
Comments
Please use Python 3.6 |
You can also try replacing import re to import regex as re |
what do you mean sub |
|
Traceback (most recent call last): File "/usr/local/Cellar/[email protected]/3.9.12_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/sre_parse.py", line 1041, in parse_template KeyError: '\s' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/spyder_kernels/py3compat.py", line 356, in compat_exec File "/Users/devharsh/Downloads/Drain_demo.py", line 28, in File "/Users/devharsh/Downloads/Drain.py", line 293, in parse File "/Users/devharsh/Downloads/Drain.py", line 224, in outputResult File "/usr/local/lib/python3.9/site-packages/pandas/core/frame.py", line 8839, in apply File "/usr/local/lib/python3.9/site-packages/pandas/core/apply.py", line 727, in apply File "/usr/local/lib/python3.9/site-packages/pandas/core/apply.py", line 851, in apply_standard File "/usr/local/lib/python3.9/site-packages/pandas/core/apply.py", line 867, in apply_series_generator File "/Users/devharsh/Downloads/Drain.py", line 347, in get_parameter_list File "/usr/local/Cellar/[email protected]/3.9.12_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 210, in sub File "/usr/local/Cellar/[email protected]/3.9.12_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 327, in _subx File "/usr/local/Cellar/[email protected]/3.9.12_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 318, in _compile_repl File "/usr/local/Cellar/[email protected]/3.9.12_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/sre_parse.py", line 1044, in parse_template error: bad escape \s |
error when I changed import re to import regex as reTraceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/spyder_kernels/py3compat.py", line 356, in compat_exec File "/Users/devharsh/Downloads/Drain_demo.py", line 28, in File "/Users/devharsh/Downloads/Drain.py", line 293, in parse File "/Users/devharsh/Downloads/Drain.py", line 224, in outputResult File "/usr/local/lib/python3.9/site-packages/pandas/core/frame.py", line 8839, in apply File "/usr/local/lib/python3.9/site-packages/pandas/core/apply.py", line 727, in apply File "/usr/local/lib/python3.9/site-packages/pandas/core/apply.py", line 851, in apply_standard File "/usr/local/lib/python3.9/site-packages/pandas/core/apply.py", line 867, in apply_series_generator File "/Users/devharsh/Downloads/Drain.py", line 347, in get_parameter_list File "/usr/local/lib/python3.9/site-packages/regex/regex.py", line 278, in sub File "/usr/local/lib/python3.9/site-packages/regex/regex.py", line 700, in _compile_replacement_helper File "/usr/local/lib/python3.9/site-packages/regex/_regex_core.py", line 1737, in _compile_replacement error: bad escape \s |
Just adding this in case someone else has this problem in 2022 when using python 3.8.10.
to
and that fixed it. Note that I changed this only in the function |
Try to degrade regex |
Hello @estebanpw I implemented your suggestion but still the problem is same. Any idea how to fix? |
also you can try |
Dear authors,
Thanks for your work. When I ran the file, "MoLFI_demo.py", based on Python3.7, I got the error as following.
I'd be grateful if you could help me.
The text was updated successfully, but these errors were encountered: