]> granicus.if.org Git - python/commitdiff
Fixed documentation to be correct for Py3k.
authorJosiah Carlson <josiah.carlson@gmail.com>
Mon, 7 Jul 2008 04:23:14 +0000 (04:23 +0000)
committerJosiah Carlson <josiah.carlson@gmail.com>
Mon, 7 Jul 2008 04:23:14 +0000 (04:23 +0000)
Doc/library/asynchat.rst
Doc/library/asyncore.rst

index ff6432e38848ec0d16e473a32ba353fda7d39e08..a8dd7e4e622578c7f3f47da4cb543857f264898a 100644 (file)
@@ -5,7 +5,7 @@
 .. module:: asynchat
    :synopsis: Support for asynchronous command/response protocols.
 .. moduleauthor:: Sam Rushing <rushing@nightmare.com>
-.. sectionauthor:: Steve Holden <sholden@holdenweb.com>
+.. sectionauthor:: Steve Holden <sholden@holdenweb.com>   
 
 
 This module builds on the :mod:`asyncore` infrastructure, simplifying
@@ -283,8 +283,8 @@ any extraneous data sent by the web client are ignored. ::
            self.addr = addr
            self.sessions = sessions
            self.ibuffer = []
-           self.obuffer = ""
-           self.set_terminator("\r\n\r\n")
+           self.obuffer = b""
+           self.set_terminator(b"\r\n\r\n")
            self.reading_headers = True
            self.handling = False
            self.cgi_data = None
@@ -299,7 +299,7 @@ any extraneous data sent by the web client are ignored. ::
                self.reading_headers = False
                self.parse_headers("".join(self.ibuffer))
                self.ibuffer = []
-               if self.op.upper() == "POST":
+               if self.op.upper() == b"POST":
                    clen = self.headers.getheader("content-length")
                    self.set_terminator(int(clen))
                else:
@@ -308,7 +308,7 @@ any extraneous data sent by the web client are ignored. ::
                    self.handle_request()
            elif not self.handling:
                self.set_terminator(None) # browsers sometimes over-send
-               self.cgi_data = parse(self.headers, "".join(self.ibuffer))
+               self.cgi_data = parse(self.headers, b"".join(self.ibuffer))
                self.handling = True
                self.ibuffer = []
                self.handle_request()
index 658c8ea808def46c5d9a2638684ff114536faf28..40dc81263c17fecf96b3bbd68225ab4467a69bc6 100644 (file)
@@ -254,7 +254,7 @@ implement its socket handling::
            asyncore.dispatcher.__init__(self)
            self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
            self.connect( (host, 80) )
-           self.buffer = 'GET %s HTTP/1.0\r\n\r\n' % path
+           self.buffer = bytes('GET %s HTTP/1.0\r\n\r\n' % path, 'ascii')
 
        def handle_connect(self):
            pass