Prevent exception in from_file when user is None