Skip to content
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

python 3.7 incompatible with the code #16

Closed
apalaios opened this issue Dec 6, 2018 · 1 comment
Closed

python 3.7 incompatible with the code #16

apalaios opened this issue Dec 6, 2018 · 1 comment

Comments

@apalaios
Copy link

apalaios commented Dec 6, 2018

Hello I am running on my Mac OS python 3.7 and it does not run the code.

The following error I get when I try to run for example LogSig:
python LogSig_demo.py
finished loading
Parsing file: ../logs/HDFS/HDFS_2k.log
Loading logs...
Traceback (most recent call last):
File "/Users/eeaplal/anaconda3/lib/python3.7/sre_parse.py", line 1021, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\s'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "LogSig_demo.py", line 15, in
parser.parse(log_file)
File "../logparser/LogSig/LogSig.py", line 267, in parse
self.loadLog()
File "../logparser/LogSig/LogSig.py", line 43, in loadLog
headers, regex = self.generate_logformat_regex(self.para.logformat)
File "../logparser/LogSig/LogSig.py", line 254, in generate_logformat_regex
splitter = re.sub(' +', '\s+', splitters[k])
File "/Users/eeaplal/anaconda3/lib/python3.7/re.py", line 192, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "/Users/eeaplal/anaconda3/lib/python3.7/re.py", line 309, in _subx
template = _compile_repl(template, pattern)
File "/Users/eeaplal/anaconda3/lib/python3.7/re.py", line 300, in _compile_repl
return sre_parse.parse_template(repl, pattern)
File "/Users/eeaplal/anaconda3/lib/python3.7/sre_parse.py", line 1024, in parse_template
raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \s at position 0

On some linux machines code runs with python 3.6
I searched a lot and I found this discussion that seems to be relevant to the problem.
Although.I do not know how to fix it.
emmett-framework/emmett#227

Any support will be appreciated.
Alex

@zhujiem
Copy link
Member

zhujiem commented Dec 6, 2018

Please follow the usage steps at: https://github.com/logpai/logparser#usage. But only the specified Python versions are supported. For other versions, users need to make the corresponding updates.

@zhujiem zhujiem closed this as completed Dec 6, 2018
xpai pushed a commit that referenced this issue Sep 5, 2023
xpai pushed a commit that referenced this issue Sep 5, 2023
xpai pushed a commit that referenced this issue Sep 5, 2023
xpai pushed a commit that referenced this issue Sep 5, 2023
* Fix PRs: merge #86, merge #85, merge #83, merge #80, merge #78, merge #65, merge #57, merge #53, merge #52, merge #51, merge #49
* Fix issues: #98, #79, #72, #84, #75, #71, #69, #56, #50, #45, #16, #82
xpai pushed a commit that referenced this issue Sep 5, 2023
xpai pushed a commit that referenced this issue Sep 5, 2023
* Close PRs: close #86, #85, #83, #80, #78, #65, #57, #53, #52, #51, #49
* Fix issues: fix #98, #79, #72, #84, #75, #71, #69, #56, #50, #45, #16, #82
* Release pypi package wheel
xpai pushed a commit that referenced this issue Sep 5, 2023
* Close PRs: close #86, #85, #83, #80, #78, #65, #57, #53, #52, #51, #49
* Fix issues: fix #98, #79, #72, #84, #75, #71, #69, #56, #50, #45, #16, #82
* Release package wheel to pypi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants