django-treewidget icon indicating copy to clipboard operation
django-treewidget copied to clipboard

Warning in runtime (py 3.12)

Open egorgam opened this issue 1 year ago • 1 comments

Getting this message every time when app is starting up:

/usr/local/lib/python3.12/site-packages/treewidget/fields.py:142: SyntaxWarning: invalid escape sequence '/'

egorgam avatar May 08 '24 01:05 egorgam

https://github.com/netzkolchose/django-treewidget/blob/48d83398a33b11a6083436a3c8b427edbc297ab2/treewidget/fields.py#L142

should be:

 'json_data': mark_safe(json_data.replace('</script', '<\\/script')),

Seems python 3.12 is more strict about that than older versions.

Edit: It still works as intended in 3.12 (just tested with python:slim docker image), my guess is, that they disable this quirk with some later version though.

jerch avatar May 08 '24 08:05 jerch