textile / python-textile

A Python port of Textile, A humane web text generator
Other
68 stars 23 forks source link

DeprecationWarnings about invalid escape sequences #73

Closed thmo closed 4 years ago

thmo commented 4 years ago

On Fedora 31, I see the following warnings when running the testsuite:

textile/core.py:47
  .../textile-4.0.0/textile/core.py:47: DeprecationWarning: invalid escape sequence \d
    btag = ('bq', 'bc', 'notextile', 'pre', 'h[1-6]', 'fn\d+', 'p', '###')

textile/core.py:353
  .../textile-4.0.0/textile/core.py:353: DeprecationWarning: invalid escape sequence \*
    nm = re.match("^(?P<nextlistitem>[#\*;:]+)(_|[\d]+)?{0}"

textile/core.py:844
  .../textile-4.0.0/textile/core.py:844: DeprecationWarning: invalid escape sequence \]
    m = re.search('(?P<url>^.*\])(?P<tight>\[.*?)$', url, flags=re.U)

textile/core.py:1262
  .../textile-4.0.0/textile/core.py:1262: DeprecationWarning: invalid escape sequence \:
    text_re = re.compile('<p>notelist({0})(?:\:([\w|{1}]))?([\^!]?)(\+?)'

textile/core.py:1263
  .../textile-4.0.0/textile/core.py:1263: DeprecationWarning: invalid escape sequence \.
    '\.?[\s]*</p>'.format(cls_re_s, syms_re_s), re.U)

These should be easily fixable by using raw strings instead.