Change line https://github.com/wchen-r7/metasploit-framework/blob/1350cd5a81da9abf137bb394471172e7b376166f/modules/auxiliary/analyze/jtr_linux.rb#L53 to a block form `File.open` and this line to the `end` of the block.