__file__ is an optional attribute that may or may not be set. Both attributes should be a str when they are available.
builtins/module.__file__
module.__file__