Re: BaseHTTPServer ThreadMixIn not working

2011-10-04 Thread Gabriel Genellina
En Mon, 03 Oct 2011 12:03:18 -0300, amit escribió: I am really stuck in a very simple problem and wanted to know if you could take some time to check it out - My code is simple. Using BaseHTTPServer and ThreadInMix I want to run a python script (Script1.py) for every request made simultaneousl

Re: BaseHTTPServer get_request not called till first request

2010-01-17 Thread Adam Tauno Williams
On Sat, 2010-01-16 at 18:35 -0800, yousay wrote: > On Jan 13, 1:38 am, Adam Tauno Williams > wrote: > > Looking at and > > as examples I've attempted > > to create a BaseHTTPServer class that times-out acce

Re: BaseHTTPServer get_request not called till first request

2010-01-16 Thread yousay
On Jan 13, 1:38 am, Adam Tauno Williams wrote: > Looking at and > as examples I've attempted > to create a BaseHTTPServer class that times-out accept() ever X seconds > to check some other work.  This seems

Re: BaseHttpServer

2009-02-15 Thread Paul
On Feb 15, 8:46 pm, Steve Holden wrote: > Paul wrote: > > Hi, > > I currently have a webserver using BaseHttpServe that serves images > > like this: > > if self.path.endswith(".jpg"): > >                 print(curdir + sep + self.path) > >                 f = open(curdir + sep + self.path,"b") > >

Re: BaseHttpServer

2009-02-15 Thread Steve Holden
Paul wrote: > Hi, > I currently have a webserver using BaseHttpServe that serves images > like this: > if self.path.endswith(".jpg"): > print(curdir + sep + self.path) > f = open(curdir + sep + self.path,"b") > self.send_response(200) >

Re: BaseHttpServer

2009-02-15 Thread Pierre Quentel
On 15 fév, 18:31, Paul wrote: > Hi, > I currently have a webserver using BaseHttpServe that serves images > like this: > if self.path.endswith(".jpg"): >                 print(curdir + sep + self.path) >                 f = open(curdir + sep + self.path,"b") >                 self.send_response(20

Re: [BaseHTTPServer/SimpleHTTPServer] Remove "Server:" header

2008-10-03 Thread Gabriel Genellina
[EMAIL PROTECTED] wrote: I'm using SimpleHTTPServer (work well) but it always sends "Server" header in response: How can I remove that ? En Fri, 03 Oct 2008 11:11:34 -0300, Gary M. Josack <[EMAIL PROTECTED]> escribió: you've got ?self.send_header('Server', self.version_string()) in the send

Re: [BaseHTTPServer/SimpleHTTPServer] Remove "Server:" header

2008-10-03 Thread Gary M. Josack
you've got ?self.send_header('Server', self.version_string()) in the send_response method of the BaseHTTPRequestHandler class in the BaseHTTPServer module. Long story, short, it's going to be a lot of work to get rid of. [EMAIL PROTECTED] wrote: Hello. I'm using SimpleHTTPServer (work well)

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread Gabriel Genellina
En Wed, 27 Feb 2008 10:33:35 -0200, rocksportrocker <[EMAIL PROTECTED]> escribi�: > Hi, > > I am trying to implement a local server for storing and retrieving > numerical data. > So I use BaseHTTPServer as follows: > > - > from BaseHTTP

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread rocksportrocker
If I ommit send_response() in do_POST() I get no errormessage. That is an acceptable solution for me. Greetings, Uwe -- http://mail.python.org/mailman/listinfo/python-list

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread rocksportrocker
On Feb 27, 2:50 pm, 7stud <[EMAIL PROTECTED]> wrote: > ... > I don't get that error. On the server, I get the output: > > POST > localhost - - [27/Feb/2008 06:49:13] "POST / HTTP/1.1" 200 - > > and on the client I get: > > None > In my case the server says: Traceback (most recent call last

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread 7stud
On Feb 27, 5:33 am, rocksportrocker <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to implement a local server for storing and retrieving > numerical data. > So I use BaseHTTPServer as follows: > > - >     from BaseHTTPServer import * > >  

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread rocksportrocker
On Feb 27, 1:28 pm, rocksportrocker <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to implement a local server for storing and retrieving > numerical data. > So I used BaseHTTPServer as follows: > > from BaseHTTPServer import * > > class Handler(BaseHTTPRequestHandler): > > def do_POST(self):

Re: BaseHTTPServer and Apache

2007-04-14 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On Apr 13, 8:44 pm, Ron Garret <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > > Ron Garret <[EMAIL PROTECTED]> wrote: > > > > > Does > > > anyone know of a straightforward way to get Apache to "forw

Re: BaseHTTPServer and Apache

2007-04-13 Thread Luis M. González
On Apr 13, 8:44 pm, Ron Garret <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Ron Garret <[EMAIL PROTECTED]> wrote: > > > Does > > anyone know of a straightforward way to get Apache to "forward" requests > > to a given path to another HTTP server running on a different port? > > Ne

Re: BaseHTTPServer and Apache

2007-04-13 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Ron Garret <[EMAIL PROTECTED]> wrote: > Does > anyone know of a straightforward way to get Apache to "forward" requests > to a given path to another HTTP server running on a different port? Never mind, I think I figured it out. Apparently what I need is the Pr

Re: BaseHTTPServer - getting POST parameters

2006-11-14 Thread Fredrik Lundh
Vlad Dogaru wrote: > After experimenting for a while, I am still not able to find where the > POST data is in the BaseHTTPRequestHandler class. I am trying to write > a very simple HTTP server for a project of mine and I need to get the > POST data. Certainly I am missing something, as it is a com

Re: BaseHTTPServer - getting POST parameters

2006-11-14 Thread Paul Boddie
Vlad Dogaru wrote: > > After experimenting for a while, I am still not able to find where the > POST data is in the BaseHTTPRequestHandler class. I am trying to write > a very simple HTTP server for a project of mine and I need to get the > POST data. Certainly I am missing something, as it is a co

Re: BaseHTTPServer weirdness

2006-09-12 Thread Eddie Corns
Ron Garret <[EMAIL PROTECTED]> writes: >In article <[EMAIL PROTECTED]>, > Steve Holden <[EMAIL PROTECTED]> wrote: >> I wouldn't necessarily say you are wrong here, It's just that the cgi >> module has sort of "just growed", so it isn't conveniently factyored for >> reusability in other contexts

Re: BaseHTTPServer weirdness

2006-09-12 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > I wouldn't necessarily say you are wrong here, It's just that the cgi > module has sort of "just growed", so it isn't conveniently factyored for > reusability in other contexts. Several people (including me) have taken >

Re: BaseHTTPServer weirdness

2006-09-12 Thread Steve Holden
Ron Garret wrote: > In article <[EMAIL PROTECTED]>, > Kent Johnson <[EMAIL PROTECTED]> wrote: > > >>Steve Holden wrote: >> >>>Ron Garret wrote: >>> In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: >But basically, you aren't providing a CGI envir

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Damjan <[EMAIL PROTECTED]> wrote: > >> But basically, you aren't providing a CGI environment, and that's why > >> cgi.parse() isn't working. > > > > Clearly. So what should I be doing? > > Probably you'll need to read the source of cgi.parse_qs (like Steve did)

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Kent Johnson <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > > Ron Garret wrote: > >> In article <[EMAIL PROTECTED]>, > >> Steve Holden <[EMAIL PROTECTED]> wrote: > >> > >> > >>> But basically, you aren't providing a CGI environment, and that's why > >>> cgi.p

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > In article <[EMAIL PROTECTED]>, > > Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > >>But basically, you aren't providing a CGI environment, and that's why > >>cgi.parse() isn't working. > > > >

Re: BaseHTTPServer weirdness

2006-09-11 Thread Steve Holden
Ron Garret wrote: > In article <[EMAIL PROTECTED]>, > Steve Holden <[EMAIL PROTECTED]> wrote: > > >>But basically, you aren't providing a CGI environment, and that's why >>cgi.parse() isn't working. > > > Clearly. So what should I be doing? Surely I'm not the first person to > have this pr

Re: BaseHTTPServer weirdness

2006-09-11 Thread Damjan
>> But basically, you aren't providing a CGI environment, and that's why >> cgi.parse() isn't working. > > Clearly. So what should I be doing? Probably you'll need to read the source of cgi.parse_qs (like Steve did) and see what it needs from os.environ and then provide that (either in os.envir

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > But basically, you aren't providing a CGI environment, and that's why > cgi.parse() isn't working. Clearly. So what should I be doing? Surely I'm not the first person to have this problem? I have managed to work aroun

Re: BaseHTTPServer weirdness

2006-09-11 Thread Steve Holden
Ron Garret wrote: > In article <[EMAIL PROTECTED]>, > Steve Holden <[EMAIL PROTECTED]> wrote: > > >>The normal way is >> >>s = cgi.parse() >> >>since the CGI script sees the client network socket (after consumption >>of HTTP headers) as its standard input. > > > Doesn't work. (I even tried s

Re: BaseHTTPServer weirdness

2006-09-11 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > The normal way is > > s = cgi.parse() > > since the CGI script sees the client network socket (after consumption > of HTTP headers) as its standard input. Doesn't work. (I even tried sys.stdin=r.rfile; s=cgi.parse())

Re: BaseHTTPServer weirdness

2006-09-11 Thread Steve Holden
Ron Garret wrote: > I'm trying to figure out how to use BaseHTTPServer. Here's my little > test app: > > = > > #!/usr/bin/python > > from BaseHTTPServer import * > > import cgi > > class myHandler(BaseHTTPRequestHandler): > > def do_GET(r): > s = '' >

Re: BaseHTTPServer module

2005-12-01 Thread Peter Hansen
amfr wrote: > I looked at the doumentation and is says rfile is: > "Contains an input stream, positioned at the start of the optional > input data." > How do i get the input out of it? As with any "input stream" (file-like object) in Python, you call file methods like .read() or maybe .readline()

Re: BaseHTTPServer module

2005-12-01 Thread amfr
I looked at the doumentation and is says rfile is: "Contains an input stream, positioned at the start of the optional input data." How do i get the input out of it? -- http://mail.python.org/mailman/listinfo/python-list

Re: BaseHTTPServer module

2005-11-21 Thread amfr
Thanks, all I wanted to know where the post data was stored from the request -- http://mail.python.org/mailman/listinfo/python-list

Re: BaseHTTPServer module

2005-11-20 Thread Tim Roberts
"amfr" <[EMAIL PROTECTED]> wrote: > >>From the BaseHTTPServer module, how do i gget the POST or GET data sent >by the client? Is it stired the the file they requested? e.g. >objectname.path Did you check the documentation in the module? You need to derive your own class from BaseHTTPServer. In

Re: BaseHTTPServer and priviledge separation?

2005-06-25 Thread Lee Harr
> to use a port below 1000 on a Unix system one needs root priviledges. > But it's dangerous to execute all of a script under those priviledges. > Therefore I'd like to drop the root priviledges as soon as possible. > (How) is this possible? > Are you sure you don't just want to use twisted? http

Re: BaseHTTPServer threading using SocketServer.ThreadingMixIn

2005-02-20 Thread Tortelini
It's not that, here is definition that I use: class myWebServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer): pass code that runs server: server = myWebServer(('', 80), myWebHTTPHandler) LOG("Web Server starting") server.serve_forever() and here is shortened version of myWebHTTPHandl

Re: BaseHTTPServer threading using SocketServer.ThreadingMixIn

2005-02-20 Thread Paul Rubin
"Tortelini" <[EMAIL PROTECTED]> writes: > I am making custom web server using HTTPServer and want to be able to > access it simultaneously from different computers. To achieve > multithreading, I have been experimenting with ThreadingMixIn from > SocketServer, but it doesn't seem to work, One com