diff options
| author | Chris McDonough <chrism@plope.com> | 2012-02-20 21:27:19 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2012-02-20 21:27:19 -0500 |
| commit | 22bae974cf49a80fd60bfe51b110ee00e91e729b (patch) | |
| tree | f650b43a546605d6cd7b32bff8b5926ebcc3268b | |
| parent | 40301d8132a3f633dc0b5e941e8bd82a29f0fb36 (diff) | |
| download | pyramid-22bae974cf49a80fd60bfe51b110ee00e91e729b.tar.gz pyramid-22bae974cf49a80fd60bfe51b110ee00e91e729b.tar.bz2 pyramid-22bae974cf49a80fd60bfe51b110ee00e91e729b.zip | |
- The static file response object used by ``config.add_static_view`` opened
the static file twice, when it only needed to open it once.
| -rw-r--r-- | CHANGES.txt | 6 | ||||
| -rw-r--r-- | pyramid/static.py | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index e8b2326e4..8595e726e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -28,6 +28,12 @@ Backwards Incompatibilities - 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) ================== diff --git a/pyramid/static.py b/pyramid/static.py index 8788d016d..e91485fad 100644 --- a/pyramid/static.py +++ b/pyramid/static.py @@ -68,7 +68,7 @@ class _FileResponse(Response): 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 |
