Open henrique25teles opened 2 years ago
By the way I'm using wiki.py script
This regex is for replacing the links of Redmine to the new ones for Azure. It seems that the string contains a \A
that triggers python error? Is that correct? I'm not sure what the best solution is here. If it's only one, maybe it's the easiest to manually replace it?
It looks like I have a similar issue but then with \R.
It looks like it is new_path variable which has the value Wiki\Requirements in my case.
When trying to run the script I have an error on this line:
content = re.sub(rf"\[\[{link.group('link')}\]\]", f"[{link.group('link')}](/{new_path})", content)
And i'm receiving this on the console:
Traceback (most recent call last): File "C:\Python39\lib\sre_parse.py", line 1039, in parse_template this = chr(ESCAPES[this][1]) KeyError: '\A'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\workspace\wiki\wiki.py", line 70, in
main()
File "C:\workspace\wiki\wiki.py", line 62, in main
content = re.sub(rf"[[{link.group('link')}]]", f"{link.group('link')}", content)
File "C:\Python39\lib\re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "C:\Python39\lib\re.py", line 327, in _subx
template = _compile_repl(template, pattern)
File "C:\Python39\lib\re.py", line 318, in _compile_repl
return sre_parse.parse_template(repl, pattern)
File "C:\Python39\lib\sre_parse.py", line 1042, in parse_template
raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \A at position 24
Someone have this same issue and know how to solve this ? I'm not very familiar with python