asfadmin / Discovery-asf_search

BSD 3-Clause "New" or "Revised" License
124 stars 43 forks source link

Fix for python 3.12, escape characters throw warnings #306

Closed Cameronsplaze closed 1 month ago

Cameronsplaze commented 1 month ago

From Discovery Public:

Second bullet on https://docs.python.org/3/whatsnew/3.12.html#other-language-changes

Python throws a warning on this line. Escaping the slash fixes it on 3.12.

>>> "\,"
<stdin>:1: SyntaxWarning: invalid escape sequence '\,'
'\\,'
>>> "\\,"
'\\,'

(Though they moved it from a DeprecationWarning to a SyntaxWarning. It might never become an error? This would silence the warning at least)