avoid leaking temp file info in error message (#4703)