unstructured
0057f9de - fix(nltk): remedy Windows temp-file problem (#3395)

Commit
1 year ago
fix(nltk): remedy Windows temp-file problem (#3395) **Summary** The implementation of `tempfile.NamedTemporaryFile` on Windows Python is problematic in certain situations. In particular, it raises `PermissionError` when attempting to access the temporary file by name rather than just by the file-descriptor returned by the context-manager. Remedy this situation by using `tempfile.TemporaryDirectory` instead and using a file name of our choosing. The temporary directory is deleted with all its contents when the context manager closes so the effect is the same and does not produce the error on Windows.
Author
Parents
Loading