For my DEV environment I have EasyBuild running with EASYBUILD_DEBUG=5. Not sure if that makes a difference?
class ModuleGenerator, def prepare "overwrites" the filename it seems. I put a print statement after "self.filename =" in module_generator.py ... == sanity checking... /tmp/eb-RNpN24/tmp5J4Rhe/all/htop/1.0.3 == cleaning up... == creating module... /easybuild/DEVELOPMENT/modulefiles/rhel/6/all/htop/1.0.3 /tmp/eb-RNpN24/tmpAwKmVF/all/htop/1.0.3 == permissions... == packaging... <error>

