I m thinking of implementing a configuration file written in Python syntax, not unlike what Django does.
While I ve seen one or two SO questions about the merits of using executable code in configuration files, I m curious whether there is a way to execute the config file code in a "sandbox" to prevent mistakes in the code from locking up the host application.
Because the host application is a programmer s tool, I m not concerned about teaching Python syntax or introducing security holes as mentioned in at least one other SO question. But I am worried about the configuration code branching to Fishkill and wedging the host app. I d much rather that the host app trap those problems and display diagnostic error information.
Has anyone tried this sort of sandboxing for a Python configuration file? And, if so, what techniques proved useful, and what pitfalls cropped up that I should be aware of?