]> granicus.if.org Git - python/commitdiff
Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments as docum...
authorGeorg Brandl <georg@python.org>
Fri, 4 Sep 2009 08:17:04 +0000 (08:17 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 4 Sep 2009 08:17:04 +0000 (08:17 +0000)
Lib/Cookie.py
Misc/NEWS

index 1ccfd160a4997131a3ade8a73226388bb1f34f31..fc6d9f61b6c4f1a253aaa2c6e684850176a14c5f 100644 (file)
@@ -624,7 +624,9 @@ class BaseCookie(dict):
         if type(rawdata) == type(""):
             self.__ParseString(rawdata)
         else:
-            self.update(rawdata)
+            # self.update() wouldn't call our custom __setitem__
+            for k, v in rawdata.items():
+                self[k] = v
         return
     # end load()
 
index eea32c1a901847f11dd1f37ff2e4fbb4f7820021..b517b978cfc9a2cf0f81f711c3bd809b5e681d82 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -364,6 +364,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments
+  as documented.
+
 - Issue #2666: Handle BROWSER environment variable properly for unknown browser
   names in the webbrowser module.