kennethreitz/requests — pull request #1178 by shezi (2013-02-10 10:26:22+00:00)
Title: improving `super_len`

when using `StringIO` in Python 3 oder using `cStringIO` in Python 2, you will have an object that does not have a `len` AND does not have a `.fileno()`

In that case, the best method for finding the length of the backing object is to seek to the end. This assumes that the object is seekable, though.

Since we're going to load the whole object into memory anyway, memory consumption should not be increased by the seeking.