For more generic model scanning, Protect AI's modelscan is now available to scan not only Pickle files but also PyTorch, TensorFlow, and Keras.
In the example section "pickle — Python object serialization" / "Pickling Class Instances" / "Handling Stateful Objects", the TextReader class code is correct only if it will never be used as one of ...