Custom filter in state file break Python shell

We observed the following behavior on Windows with ParaView 5.6.x:

If a state file contains some custom filters (in <CustomProxyDefinitions>) they get imported into ParaView persistently (i.e. they end up in the ParaView .ini-file and you can also see them via the Tools | Manage Custom Filters menu option).

First question: Is this intended behavior?

But now to the real problem: these custom filter break the Python shell:

> from paraview.simple import *
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:/paraview/ParaView-5.6.0-Windows-msvc2015-64bit/bin\Lib/site-packages\paraview\", line 2242, in find_module
    if vtkPVPythonModule.HasModule(fullname):
AttributeError: 'NoneType' object has no attribute 'HasModule'

If I remove the custom filter via the menu manager or directly in the .ini-file and restart ParaView the Python shell is fine again.

But I also have to remove the <CustomProxyDefinitions>-element from ParaView state file to prevent ParaView from re-adding these custom filters. Have a look at the “infected” state file:

Any idea how and why this happens?
Thanks a lot!

There was a possibly related issue solved recently:

Could you try a nightly build from and see if the problem is resolve?

Thanks for the hint on the merge request! It sounds like this should relate to my problem but I tried the nightly build and my problem is still there:

  • Used ParaView-5.8.0-RC1-87-g944a1bb4f3-Windows-Python3.7-msvc2015-64bit
  • Loaded my infected state file
  • The custom filters are added to the local config
  • The Python shell gets broken

But by looking at the commit message of the fix I assume that only the leaking of unused custom filter definitions into state files was fixed, right?

I can attest that an infected state file can be cleaned up by simply re-saving it. The only thing to do manually afterwards is to remove the custom filter definitions via the menu option. Afterwards everything works as expected. So yes, I would say my problem is resolved.