Re: why this server can not run in python30

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • davy zhang

    #1

    Re: why this server can not run in python30

    thanks so much for fixing the problems!!


    On Wed, Oct 22, 2008 at 2:56 PM, Gabriel Genellina
    <gagsl-py2@yahoo.com.a rwrote:
    En Wed, 22 Oct 2008 03:45:31 -0200, davy zhang <davyzhang@gmai l.com>
    escribió:
    >
    >import asyncore, asynchat
    >import os, socket, string
    >>
    >PORT = 8000
    >>
    >class HTTPChannel(asy nchat.async_cha t):
    >>
    > def __init__(self, server, sock, addr):
    > asynchat.async_ chat.__init__(s elf, sock)
    > self.set_termin ator("\r\n")
    >
    self.set_termin ator(b"\r\n")
    >
    > self.request = None
    > self.data = ""
    >
    self.data = b""
    >
    Same for all remaining string literals, should be bytes instead.
    >
    > self.request = string.split(se lf.data, None, 2)
    >
    The string module functions are deprecated ages ago in favor of the
    corresponding string (instance) methods:
    >
    self.request = self.data.split (None, 2)
    >
    That's enough - the example worked fine for me after doing these changes.
    >
    --
    Gabriel Genellina
    >
    --

    >
Working...