def hashDirectory(self, path): self.__index.open() try: return self.__hashDir(os.fsencode(path)) finally: self.__index.close()