rapid7/metasploit-framework — pull request #972 by limhoff-r7 (2012-10-26 20:03:11+00:00)
Title: Rescue Errno::ENOENT from File.open in read_module_content 

Msf::Modules::Loader::Directory#read_module_content may calculate a non-existent module_path that gets passed to File.open causing an Errno::ENOENT exception to be raised when using the module cache with a module that has been moved to a new path (as is the case that originally found this bug) or deleted. Now, the exception is rescued and read_module_content returns an empty string (''), which load_module detects with module_content.empty? and returns earlier without attempting to module eval the (empty) content.