X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fform.py;h=98d2ed9c5c7725eedf42e5f21ad03ff527f306fb;hb=2a5a8ce70a0107b7bfd5bd3459ae4aae3a7558e2;hp=10b10f5a8bd27b68aec9d3928110cf5de5de3996;hpb=ad5b93034c1c28f0f4deab4c1b62cb2d6a869f81;p=wrw.git diff --git a/wrw/form.py b/wrw/form.py index 10b10f5..98d2ed9 100644 --- a/wrw/form.py +++ b/wrw/form.py @@ -6,7 +6,7 @@ __all__ = ["formdata"] class formwrap(object): def __init__(self, req): if req.ihead.get("Content-Type") == "application/x-www-form-urlencoded": - self.cf = cgi.parse(environ = req.env, fp = req.env["wsgi.input"]) + self.cf = cgi.parse(environ = req.env, fp = req.input) else: self.cf = cgi.parse(environ = req.env) @@ -73,7 +73,7 @@ class formpart(object): if sz >= 0 and len(self.buf) >= sz: break while len(self.form.buf) <= len(lboundary): - ret = req.env["wsgi.input"].read(8192) + ret = req.input.read(8192) if ret == "": raise badmultipart("Missing last multipart boundary") self.form.buf += ret @@ -111,6 +111,7 @@ class formpart(object): return self def __exit__(self, *excinfo): + self.close() return False def parsehead(self, charset):