Maybe I missed it but how does module_data['file'] actually get set? Wouldn't this raise a KeyError?