[PythonCE] Any way to get the webserver classes working?

Doug Marien doug@jarna.com
Mon, 28 Apr 2003 17:38:04 -0700


That would be the build I put together, but this applies to PocketPC in =
general.  The makefile call uses _open_osfhandle, dup and fdopen which =
are all unsupported on the PocketPC.  So, you're stuck to using the =
socket object. :/

You could try writing your own wrapper class and tweak the SocketServer.

Doug

-----Original Message-----
From: Dan Samblanet [mailto:dan@bloodylikely.com]
Sent: Monday, April 28, 2003 5:10 PM
To: pythonce@python.org
Subject: [PythonCE] Any way to get the webserver classes working?


	Maybe this has been covered in the past, but I sure can't easily find=20
it.  Due to my laziness, I have decided to go with a web based interface =

instead of mucking around with win32 for an app I am developing.=20
Everything so far works fine on the PC Side.  When I bring it over to my =

PPC I get the following error:

----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 1068)
Traceback (most recent call last):
   File "/Program Files/Python/lib\SocketServer.py", line 221, in=20
handle_request
     self.process_request(request, client_address)
   File "/Program Files/Python/lib\SocketServer.py", line 240, in=20
process_request
     self.finish_request(request, client_address)
   File "/Program Files/Python/lib\SocketServer.py", line 253, in=20
finish_request
     self.RequestHandlerClass(request, client_address, self)
   File "/Program Files/Python/lib\SocketServer.py", line 513, in =
__init__
     self.setup()
   File "/Program Files/Python/lib\SocketServer.py", line 553, in setup
     self.rfile =3D self.connection.makefile('rb', self.rbufsize)
AttributeError: '_socket.socket' object has no attribute 'makefile'
----------------------------------------

The code:  (currently, just like the documented example)

import CGIHTTPServer
import BaseHTTPServer

def run(server_class=3DBaseHTTPServer.HTTPServer,
         handler_class=3DCGIHTTPServer.CGIHTTPRequestHandler):
     server_address =3D ('', 8000)
     httpd =3D server_class(server_address, handler_class)
     httpd.serve_forever()

run()


My current setup is:
PythonCE 2.3 (=20
http://mail.python.org/pipermail/pythonce/2002-September/000140.html )=20
on top of the lib dir from the PPC Python R2 (However I do get the same=20
error without 2.3).

	If there are any solutions or workarounds to this issue, I would=20
appreciate hearing them.

Thanks
-Dan