Mariano Mara  committed 0394201 Merge

Merging latest changes from official repo

  • Participants
  • Parent commits bcd9eaa, f6edd94

Comments (0)

Files changed (4)

File docs/index.txt

 .. comment:
     >>> from dtopt import ELLIPSIS
 Status & License
 <>`_.  It is under active development.
 Discussion should happen on the `Paste mailing lists
 <>`_, and bugs can go on the `Paste
-trac instance <>`_.
+trac instance <>`_.  It was originally
+written by Ian Bicking, and the primary maintainer is now Sergey
 WebOb is released under an `MIT-style license <license.html>`_.
     A `dictionary-like object`_ with all the variables in the request
     body.  This only has variables if the request was a ``POST`` and
-    it is a form submission.  
+    it is a form submission.
     A `dictionary-like object`_ with a combination of everything in
 Instantiating the Response
-Of course most of the time you just want to *make* a response.  
+Of course most of the time you just want to *make* a response.
 Generally any attribute of the response can be passed in as a keyword
 argument to the class; e.g.:
 <comment-example.html>`_ shows middleware.  For applications it's more
 reasonable to use WebOb in the context of a larger framework.  `Pylons
 <>`_ uses WebOb in 0.9.7+.
     keywords='wsgi request web http',
     author='Ian Bicking',
+    maintainer='Sergey Schetinin',
+    maintainer_email='',

File tests/

     assert req.body_file is old_body_file
 class UnseekableInputWithSeek(UnseekableInput):
-    def seek(self, pos):
+    def seek(self, pos, rel=0):
         raise IOError("Invalid seek!")
 def test_broken_seek():

File webob/

         clen = self.content_length
         if clen is None:
             clen = -1
-        r =
+        f = self.environ['wsgi.input']
+        r =
         return r
     def _body__set(self, value):
         This only does a shallow copy, except of wsgi.input
+        self.make_body_seekable()
         env = self.environ.copy()
         new_req = self.__class__(env)
         assert isinstance(length, int)
         if not tempfile_limit or length <= tempfile_limit:
             return False
-        fileobj = tempfile.TemporaryFile()
+        fileobj = self.make_tempfile()
         input = self.body_file
         while length:
             data =, 65536))
         self.environ['wsgi.input'] = fileobj
         return True
+    def make_tempfile(self):
+        """
+            Create a tempfile to store big request body
+        """
+        return tempfile.TemporaryFile()
     def remove_conditional_headers(self, remove_encoding=True, remove_range=True,
                                         remove_match=True, remove_modified=True):