X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ce17b0eecaa7add29e4eb04e06b2580daa656bf2..878a1d756d34169609ab64ee228d164bbf3bfad7:/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. """