**System Information**
Operating system: Macos
Graphics card: M1
**Blender Version**
Broken: 3.1.0 release version
Worked: don't know
**Short description of error**
When assign a property with driver expression (such as `#frame`), then write a script to print out the property value at each frame in `bpy.app.handers.frame_change_post`, then render animation with `lock interface`, or command line rendering (which needs to register the script), then the value printed from python code is not updated, it always prints the same value.
**Exact steps for others to reproduce the error**
{F13973081}
Use the default cube, then change its `location.x` to `#frame`, then write a script
```
import bpy
def fun(scene, despgraph):
print("from python: "+str(bpy.data.objects['Cube'].location.x))
bpy.app.handlers.frame_change_post.append(fun)
```
then render animation with `lock interface`, the value printed from python code is **incorrect** and always the same value, (the location at the first frame to start the rendering). **But the location is correctly updated in the rendered image**.
The value can be **correctly printed**, when render without `lock interface`.
Because I mostly need it to work in command line rendering, but I found it has the same problem when render with `lock interface`
The file `untitled.blend` does the same thing as I talked above, once you open it, run the script, then render the animation, you can see the output in console.