text: Title: Python 3.12 compatibility
  Body: Python 3.12 will be released in October and the first beta is now available. I tested it and noticed that our Python evaluation using the special variable syntax `$var` is broken. This seems to be due to a subtle change in Python's tokenizer (python/cpython#104802). Luckily fixing our code is easy and with the fix all our acceptance tests pass.
  
  A much smaller issue is that our tests seem to have invalid escape sequences like `'\.'` that are nowadays reported more visibly than earlier. They need be changed to `'\\.'` or `r'\.'`.