Regarding the use of resolve_mixed_hetatm_atom_altlocs, from PR 336:
Temporary CIF cleanup can be skipped if load_any(safe_reference_path) throws: resolve_mixed_hetatm_atom_altlocs() creates a delete=False tempfile, but the current unlink() only runs after a successful load_any(). Also, a cleanup unlink() failure currently aborts patching and is reported as a parse failure. Wrapping the load + subsequent parsing in a try/finally and swallowing unlink errors avoids leaking temp files and avoids false negatives.
We should fix this not in that PR but in all locations. One way to handle this would be to encapsulate all the required logic in resolve_mixed_hetatm_atom_altlocs directly.
Regarding the use of
resolve_mixed_hetatm_atom_altlocs, from PR 336:Temporary CIF cleanup can be skipped if load_any(safe_reference_path) throws: resolve_mixed_hetatm_atom_altlocs() creates a delete=False tempfile, but the current unlink() only runs after a successful load_any(). Also, a cleanup unlink() failure currently aborts patching and is reported as a parse failure. Wrapping the load + subsequent parsing in a try/finally and swallowing unlink errors avoids leaking temp files and avoids false negatives.
We should fix this not in that PR but in all locations. One way to handle this would be to encapsulate all the required logic in
resolve_mixed_hetatm_atom_altlocsdirectly.