Assume I have a black list about what non accessible directories no_access_path=os.environ.get("NO_ACCESS_PATH").split(';') if os.environ.get("NO_ACCESS_PATH") I creat a subprocess: ## touch /tmp/not_access/test.gz no_access_path=['/tmp/not_access'] proc = subprocess.Popen('ls /tmp/not_access') Expect output: raise error or return empty I've known that chroot seems to be able to meet this requirement in linux, but I can't implement it in python. Are there any solutions or open-source tools available? Continue reading...