Is your feature request related to a problem? Please describe.
For python versions lower than 3.10, the tempfile package directory clean up does not always work.
Describe the solution you'd like
At the moment, we use the correct kwarg input for python versions at or above 3.10, and try/execpt loops for lower versions. Once all versions are high enough, the try/execpt loops should be removed.
Describe alternatives you've considered
Leave old code hanging around