tmp_path kwarg in dbtables.get_connection_filename not working for python 3
This appears to be leveraging temporary_file.unlink()
, which was an undocumented feature in python 2 and doesn't exist in python 3. Some more information in https://stackoverflow.com/a/28067461.
A traceback from a gstlal job failing when using this functionality:
Traceback (most recent call last):
File "/usr/bin/gstlal_inspiral_plotsummary", line 1814, in <module>
working_filename = dbtables.get_connection_filename(filename, tmp_path = options.tmp_space, verbose = options.verbose)
File "/usr/lib64/python3.6/site-packages/ligo/lw/dbtables.py", line 253, in get_connection_filename
target = mktmp(tmp_path, suffix = ".".join(os.path.split(filename)[-1].split(".")[1:]), verbose = verbose)
File "/usr/lib64/python3.6/site-packages/ligo/lw/dbtables.py", line 196, in mktmp
def new_unlink(self, orig_unlink = temporary_file.unlink):
File "/usr/lib64/python3.6/tempfile.py", line 480, in __getattr__
a = getattr(file, name)
AttributeError: '_io.BufferedRandom' object has no attribute 'unlink'