X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/17a65d82bb002e482f9aa26d29f9a4ab8e3aeb7c..0a19cc18e5060e02eb76850cf428a4d9c48ec0c1:/nominatim/api/logging.py diff --git a/nominatim/api/logging.py b/nominatim/api/logging.py index 37855790..5b6d0e4d 100644 --- a/nominatim/api/logging.py +++ b/nominatim/api/logging.py @@ -99,6 +99,7 @@ class BaseLogger: if sa.__version__.startswith('1'): try: + sqlstr = re.sub(r'__\[POSTCOMPILE_[^]]*\]', '%s', sqlstr) return sqlstr % tuple((repr(params.get(name, None)) for name in compiled.positiontup)) # type: ignore except TypeError: @@ -107,9 +108,9 @@ class BaseLogger: # Fixes an odd issue with Python 3.7 where percentages are not # quoted correctly. sqlstr = re.sub(r'%(?!\()', '%%', sqlstr) + sqlstr = re.sub(r'__\[POSTCOMPILE_([^]]*)\]', r'%(\1)s', sqlstr) return sqlstr % params - class HTMLLogger(BaseLogger): """ Logger that formats messages in HTML. """