agateblue / django-dynamic-preferences

Dynamic global and instance settings for your django project
https://django-dynamic-preferences.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
348 stars 86 forks source link

add raw prefix to invalid regex #299

Closed deronnax closed 1 year ago

deronnax commented 1 year ago

Without the r prefix, it's an invalid escape sequence. It just blowed up in our CI, and I don't know why it did not blow earlier.

  File "/builds/.venv/lib/python3.10/site-packages/dynamic_preferences/preferences.py", line 25
    if not re.match("^\w+$", name):
                    ^^^^^^^
SyntaxError: invalid escape sequence '\w'
deronnax commented 1 year ago

Hmmm I thought recent python versions made it a SyntaxError (that's what is planned, at least), but it seems actually it's not the case yet, so I guess I messed up with our configuration. Anyway, thanks :)