make sure fdopen always closes the fd in error cases (closes #21191)
diff --git a/Misc/NEWS b/Misc/NEWS
index a6dfc7e..873c7b6 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -43,6 +43,9 @@
 Library
 -------
 
+- Issue #21191: In os.fdopen, alwyas close the file descriptor when an exception
+  happens.
+
 - Issue #21149: Improved thread-safety in logging cleanup during interpreter
   shutdown. Thanks to Devin Jeanpierre for the patch.