It was found recently that the pattern cache for a single-file mod is broken as it will try and resolve the path to the .cache folder based on the path of the single file mod (ie. <something>/mod.py/.cache) which will not be a valid path.
This path should instead be in the user directory like other cases.