AttributeError: 'vtkPythonStdStreamCaptureHelper' object has no attribute 'fileno'

I have a Python script that imports genericIO (hacc / GenericIO · GitLab) and uses its functions. The code runs successfully with standard Python, but I would like to incorporate functions from ParaView, which requires me to run the script with pvpython.

However, when I execute the script using pvpython, I encounter the following error:

AttributeError: 'vtkPythonStdStreamCaptureHelper' object has no attribute 'fileno'

I’m wondering if anyone knows the cause of this error and how to fix it. Could it be related to a version mismatch between the VTK used by genericIO and the one used by ParaView?

Any insights would be greatly appreciated!

Please share your script

The script is as following:

import sys 
import faulthandler
import sys 
sys.path.append("/vast/home/mhan/externals/genericio/legacy_python")
import genericio as gio
from paraview.simple import *

if __name__ == "__main__":
    inputfilename = "m000p-247.haloproperties"  # genericIO format
    print("inputfilename", inputfilename)
    faulthandler.enable()
    gio.inspect_gio(inputfilename)

It uses genericIO library. But using ./pvpython to execute it raised seg fault.

Thank you.

what happens if you comment out from paraview.simple import * ?

The same error occurs even if I comment out the line from paraview.simple import * .
The error appears when I run the script using pvpython.
Thanks!

@MengjiaoH I got the script running on my end, up until it tries to load the data. I don’t have the data which is ok. I can reproduce the error.

For me, the error occurs on faulthandler.enable(). Can you try commenting out that line keeping the rest the same?