Skip to content

python 3.7 incompatible with the code #16

Description

@apalaios

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions