Infinite hangup when using CGI sys.stdin.read()

2008-12-07 Thread pacsciadmin
I maintain a CGI framework named PyTin, and while previously the
developer was only allowed to access GET and POST by cgi.FieldStorage.
I'm trying to add code to my request gatherer that looks like:

1. request.rawpost = StringIO() # Just normal StringIO
2. request.rawpost.write(sys.stdin.read())
3. request.rawpost.seek(0)
4. request.fields = cgi.FieldStorage(fp=request.rawpost)
5. request.rawpost.seek(0)

Obviously, my actual code doesn't have the line numbers.

I'm testing it out on the CGIHTTPRequestHandler with BaseHTTPServer,
and whenever my test script reaches line 2, it hangs up. It doesn't
spit out a traceback, or stop in less than a minute, whenever I use
sys.stdin.read(). Can anyone explain what is going on?

Regards,
LeafStorm
BDFL: Pacific Science
--
http://mail.python.org/mailman/listinfo/python-list


Copying files in directory

2008-12-15 Thread pacsciadmin
I'm writing a project management system, and I need the ability to
accept a directory name and move its contents to another directory.
Can someone give me a code sample that will handle this? I can't find
any "copying" functions in os or os.path.

Regards,
LeafStorm
--
http://mail.python.org/mailman/listinfo/python-list