close the file even if an exception occurs #5536
diff --git a/Misc/NEWS b/Misc/NEWS
index 5d494df..0b02dd9 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -188,6 +188,9 @@
 Library
 -------
 
+- Issue #5536: urllib.urlretrieve makes sure to close the file it's writing to
+  even if an exception occurs.
+
 - Issue #5381: Added object_pairs_hook to the json module.  This allows
   OrderedDicts to be built by the decoder.