Permalink
Browse files

- Fix a bug in ``repoze.bfg.wsgi.HTTPException``: the content length

  was returned as an int rather than as a string.
  • Loading branch information...
1 parent 9d93702 commit 2c100e84a36c8ac5fac0684b201ce2050ba1aab0 Chris McDonough committed Mar 31, 2009
Showing with 16 additions and 6 deletions.
  1. +10 −1 CHANGES.txt
  2. +4 −4 repoze/bfg/tests/test_wsgi.py
  3. +2 −1 repoze/bfg/wsgi.py
View
@@ -1,6 +1,12 @@
Next release
============
+Bug Fixes
+---------
+
+- Fix a bug in ``repoze.bfg.wsgi.HTTPException``: the content length
+ was returned as an int rather than as a string.
+
- Add explicit dependencies on ``zope.deferredimport``,
``zope.deprecation``, and ``zope.proxy`` for forward compatibility
reasons (``zope.component`` will stop relying on
@@ -18,9 +24,12 @@ Next release
empty string, and, as a result, the error won't be raised. Of
course the URL or path will still be bogus.
+Features
+--------
+
- Make it possible to have ``testing.DummyTemplateRenderer`` return
some nondefault string representation.
-
+
0.6.9 (2009-02-16)
==================
@@ -30,7 +30,7 @@ def start_response(status, headers):
self.assertEqual(len(result), 1)
self.failUnless('404 Not Found' in result[0])
self.assertEqual(L[0][0], '404 Not Found')
- self.assertEqual(L[0][1], [('Content-Length', len(result[0])),
+ self.assertEqual(L[0][1], [('Content-Length', str(len(result[0]))),
('Content-Type', 'text/html')])
def test_with_message(self):
@@ -44,7 +44,7 @@ def start_response(status, headers):
self.failUnless('404 Not Found' in result[0])
self.failUnless('<hi!>' in result[0])
self.assertEqual(L[0][0], '404 Not Found')
- self.assertEqual(L[0][1], [('Content-Length', len(result[0])),
+ self.assertEqual(L[0][1], [('Content-Length', str(len(result[0]))),
('Content-Type', 'text/html')])
class TestUnauthorized(unittest.TestCase):
@@ -65,7 +65,7 @@ def start_response(status, headers):
self.assertEqual(len(result), 1)
self.failUnless('401 Unauthorized' in result[0])
self.assertEqual(L[0][0], '401 Unauthorized')
- self.assertEqual(L[0][1], [('Content-Length', len(result[0])),
+ self.assertEqual(L[0][1], [('Content-Length', str(len(result[0]))),
('Content-Type', 'text/html')])
def test_with_message(self):
@@ -79,7 +79,7 @@ def start_response(status, headers):
self.failUnless('401 Unauthorized' in result[0])
self.failUnless('<hi!>' in result[0])
self.assertEqual(L[0][0], '401 Unauthorized')
- self.assertEqual(L[0][1], [('Content-Length', len(result[0])),
+ self.assertEqual(L[0][1], [('Content-Length', str(len(result[0]))),
('Content-Type', 'text/html')])
def dummyapp(environ, start_response):
View
@@ -44,7 +44,8 @@ def __call__(self, environ, start_response, exc_info=False):
<html><title>%s</title><body><h1>%s</h1>
<code>%s</code>
""" % (self.status, self.status, msg)
- headers = [('Content-Length', len(html)), ('Content-Type', 'text/html')]
+ headers = [('Content-Length', str(len(html))),
+ ('Content-Type', 'text/html')]
start_response(self.status, headers)
return [html]

0 comments on commit 2c100e8

Please sign in to comment.