Error in python script for extract selected section

Hi all. I am using start Trace to create a python script. After I extract the section I want, I stop Trace and save the script. When I load the script, I encounter an error where it is shown in the figure

. I am confirm that my script is working without extract the selected section. However, it becomes not working anymore when I extract the section from the main body.

I am using Paraview 5.7. Is this a bug or I need to add extra plugin to get it works?

Thank you.

I believe you have found a known implelentation hole. ParaView, up to the current release, does not correctly trace any selections. Thus, if you extract selection, the extract has no selection to use!

This has been implemented in master, and will show up in ParaView 5.8.0, out in the early winter time frame. In the mean time, you can find this functionality in the nightly build, on the ParaView website.