johnjosephhorton / WritingSmellDetector

Writing Smell Detector is a tool to help find problems in your writing
Other
7 stars 2 forks source link

Something changed w/ re in Python3 #7

Open johnjosephhorton opened 1 year ago

johnjosephhorton commented 1 year ago

Here's running the get_rulesets

cc: @utapyngo

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.12) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "/usr/lib/python3.8/sre_parse.py", line 1039, 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 "regex_rules.py", line 159, in <module>
    r = get_rulesets()
  File "regex_rules.py", line 149, in get_rulesets
    ruleset = RegularExpressionRuleset(ruleset_dict,
  File "regex_rules.py", line 106, in __init__
    self.rules = [
  File "regex_rules.py", line 107, in <listcomp>
    RegularExpressionRule(self, self.props, d, self.flags, self.replace)
  File "regex_rules.py", line 66, in __init__
    patern = re.sub(search_string, replacement, patern)
  File "/usr/lib/python3.8/re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/usr/lib/python3.8/re.py", line 327, in _subx
    template = _compile_repl(template, pattern)
  File "/usr/lib/python3.8/re.py", line 318, in _compile_repl
    return sre_parse.parse_template(repl, pattern)
  File "/usr/lib/python3.8/sre_parse.py", line 1042, in parse_template
    raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \s at position 0
utapyngo commented 1 year ago

Oh, are you still using it?! Will try to run it this week.

johnjosephhorton commented 1 year ago

Yes, plus ChatGPT is giving me all sorts of ideas on how to improve it :)

utapyngo commented 1 year ago

Yes, plus ChatGPT is giving me all sorts of ideas on how to improve it :)

I think it can completely re-write it.