[Python-checkins] python/dist/src/Doc/lib libcookie.tex,1.12,1.13

birkenfeld@users.sourceforge.net birkenfeld at users.sourceforge.net
Thu Aug 25 00:34:31 CEST 2005


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27394/Doc/lib

Modified Files:
	libcookie.tex 
Log Message:
patch #848017: make Cookie more RFC-compliant.



Index: libcookie.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcookie.tex,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- libcookie.tex	31 May 2004 18:22:39 -0000	1.12
+++ libcookie.tex	24 Aug 2005 22:34:21 -0000	1.13
@@ -98,7 +98,9 @@
 Return a string representation suitable to be sent as HTTP headers.
 \var{attrs} and \var{header} are sent to each \class{Morsel}'s
 \method{output()} method. \var{sep} is used to join the headers
-together, and is by default a newline.
+together, and is by default the combination '\r\n' (CRLF).
+\versionchanged[The default separator has been changed from '\n' to match the cookie
+specification]{2.5}
 \end{methoddesc}
 
 \begin{methoddesc}[BaseCookie]{js_output}{\optional{attrs}}
@@ -195,32 +197,32 @@
 >>> C["fig"] = "newton"
 >>> C["sugar"] = "wafer"
 >>> print C # generate HTTP headers
-Set-Cookie: sugar=wafer;
-Set-Cookie: fig=newton;
+Set-Cookie: sugar=wafer
+Set-Cookie: fig=newton
 >>> print C.output() # same thing
-Set-Cookie: sugar=wafer;
-Set-Cookie: fig=newton;
+Set-Cookie: sugar=wafer
+Set-Cookie: fig=newton
 >>> C = Cookie.SmartCookie()
 >>> C["rocky"] = "road"
 >>> C["rocky"]["path"] = "/cookie"
 >>> print C.output(header="Cookie:")
-Cookie: rocky=road; Path=/cookie;
+Cookie: rocky=road; Path=/cookie
 >>> print C.output(attrs=[], header="Cookie:")
-Cookie: rocky=road;
+Cookie: rocky=road
 >>> C = Cookie.SmartCookie()
 >>> C.load("chips=ahoy; vienna=finger") # load from a string (HTTP header)
 >>> print C
-Set-Cookie: vienna=finger;
-Set-Cookie: chips=ahoy;
+Set-Cookie: vienna=finger
+Set-Cookie: chips=ahoy
 >>> C = Cookie.SmartCookie()
 >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
 >>> print C
-Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;";
+Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;"
 >>> C = Cookie.SmartCookie()
 >>> C["oreo"] = "doublestuff"
 >>> C["oreo"]["path"] = "/"
 >>> print C
-Set-Cookie: oreo=doublestuff; Path=/;
+Set-Cookie: oreo=doublestuff; Path=/
 >>> C = Cookie.SmartCookie()
 >>> C["twix"] = "none for you"
 >>> C["twix"].value
@@ -233,8 +235,8 @@
 >>> C["string"].value
 'seven'
 >>> print C
-Set-Cookie: number=7;
-Set-Cookie: string=seven;
+Set-Cookie: number=7
+Set-Cookie: string=seven
 >>> C = Cookie.SerialCookie()
 >>> C["number"] = 7
 >>> C["string"] = "seven"
@@ -243,8 +245,8 @@
 >>> C["string"].value
 'seven'
 >>> print C
-Set-Cookie: number="I7\012.";
-Set-Cookie: string="S'seven'\012p1\012.";
+Set-Cookie: number="I7\012."
+Set-Cookie: string="S'seven'\012p1\012."
 >>> C = Cookie.SmartCookie()
 >>> C["number"] = 7
 >>> C["string"] = "seven"
@@ -253,6 +255,6 @@
 >>> C["string"].value
 'seven'
 >>> print C
-Set-Cookie: number="I7\012.";
-Set-Cookie: string=seven;
+Set-Cookie: number="I7\012."
+Set-Cookie: string=seven
 \end{verbatim}



More information about the Python-checkins mailing list