You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/Users/jeff/Documents/Projects/lute-v3/lute/db/data_cleanup.py", line 39, in clean_data
_set_texts_word_count(session)
File "/Users/jeff/Documents/Projects/lute-v3/lute/db/data_cleanup.py", line 30, in _set_texts_word_count
pt = t.book.language.get_parsed_tokens(t.text)
File "/Users/jeff/Documents/Projects/lute-v3/lute/models/language.py", line 127, in get_parsed_tokens
return self.parser.get_parsed_tokens(s, self)
File "/Users/jeff/Documents/Projects/lute-v3/lute/parse/space_delimited_parser.py", line 169, in get_parsed_tokens
return self._parse_to_tokens(clean_text, language)
File "/Users/jeff/Documents/Projects/lute-v3/lute/parse/space_delimited_parser.py", line 203, in _parse_to_tokens
self.parse_para(para, lang, tokens)
File "/Users/jeff/Documents/Projects/lute-v3/lute/parse/space_delimited_parser.py", line 222, in parse_para
m = self.preg_match_capture(pattern, text)
..... etc etc
raise source.error('bad escape %s' % escape, len(escape))
re.error: bad escape \p at position 37
I added a print to the space del parser
$ git diff
diff --git a/lute/parse/space_delimited_parser.py b/lute/parse/space_delimited_parser.py
index 0ef26979..e9bb0ba8 100644
--- a/lute/parse/space_delimited_parser.py
+++ b/lute/parse/space_delimited_parser.py
@@ -34,6 +34,7 @@ class SpaceDelimitedParser(AbstractParser):
@functools.lru_cache
def compile_re_pattern(pattern: str, *args, **kwargs) -> re.Pattern:
"""Compile regular expression pattern, cache result for fast re-use."""
+ print(pattern, flush=True)
return re.compile(pattern, *args, **kwargs)
From Discord, a user (Shijui) configured the space delimited parser like this:
which caused Lute to fail at startup:
I added a print to the space del parser
and got
It didn't like the "\p" -- but that shouldn't break the entire parser, and shouldn't cause Lute to completely die.
The text was updated successfully, but these errors were encountered: