That is what happens when one doesn't learn the available tooling for doing deterministic resource management in GC languages.
Other than Python's `with` and alikes, wrapping in a closure, `defer`/`scope` (Go/D), what else is there? What am I missing? None of these work if the lifetime of a resource is not a simple "this scope".
Idris2 and now Haskell have linear types.