Chris McDonough
2012-02-21 22bae974cf49a80fd60bfe51b110ee00e91e729b
- The static file response object used by ``config.add_static_view`` opened
the static file twice, when it only needed to open it once.
2 files modified
8 ■■■■ changed files
CHANGES.txt 6 ●●●●● patch | view | raw | blame | history
pyramid/static.py 2 ●●● patch | view | raw | blame | history
CHANGES.txt
@@ -28,6 +28,12 @@
- The ``pyramid.registry.noop_introspector`` API object has been removed.
Bug Fixes
---------
- The static file response object used by ``config.add_static_view`` opened
  the static file twice, when it only needed to open it once.
1.3a8 (2012-02-19)
==================
pyramid/static.py
@@ -68,7 +68,7 @@
        if 'wsgi.file_wrapper' in environ:
            app_iter = environ['wsgi.file_wrapper'](f, _BLOCK_SIZE)
        else:
            app_iter = _FileIter(open(path, 'rb'), _BLOCK_SIZE)
            app_iter = _FileIter(f, _BLOCK_SIZE)
        self.app_iter = app_iter
        # assignment of content_length must come after assignment of app_iter
        self.content_length = content_length