Using the util write_file without a dir path will raise an exception:
FileNotFoundError: [Errno 2] No such file or directory: ''
This is minor bug, but becomes an annoyance if used to write to the local directory without a path prefix, as 'save my-tmp-config' now does after T6007 (not yet backported), looking ahead to T6472.
Fix the simple bug now and backport.