posit-dev / py-htmltools

Tools for HTML generation and output
MIT License
19 stars 4 forks source link

Clean up temporary files #91

Open machow opened 4 months ago

machow commented 4 months ago

Currently, htmltools puts files in the folder returned by tempfile.gettempdir, but does not unlink them. If it uses the mechanisms in classes like tempfile.NamedTemporaryFiles or tempfile.TemporaryDirectory, then they can be automatically unliked (e.g. by a context manager)

https://github.com/posit-dev/py-htmltools/blob/930db1711bac0b51c9c4c6ec393ea4a5edc747c8/htmltools/_core.py#L1761