summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-03-18 18:10:00 -0400
committerChris McDonough <chrism@plope.com>2012-03-18 18:10:00 -0400
commitac7d27dfb97bf887f8688264187db4a6c7be18ff (patch)
tree2953fd7844bebdc6b407d6cbfedd4194724b2fbc
parent811494584847b8108a462c28ce50f9cf30f0fb6b (diff)
parent2b41345e815c2e584fd51bbe534ba35e222f3b80 (diff)
downloadpyramid-ac7d27dfb97bf887f8688264187db4a6c7be18ff.tar.gz
pyramid-ac7d27dfb97bf887f8688264187db4a6c7be18ff.tar.bz2
pyramid-ac7d27dfb97bf887f8688264187db4a6c7be18ff.zip
Merge branch '1.3-branch'
-rw-r--r--CHANGES.txt10
-rw-r--r--docs/conf.py2
-rw-r--r--docs/python-3.pngbin0 -> 8858 bytes
-rw-r--r--docs/whatsnew-1.3.rst2
-rw-r--r--pyramid/request.py10
-rw-r--r--pyramid/tests/test_request.py12
-rw-r--r--setup.py2
7 files changed, 36 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index f12e98a8b..d52c8d479 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,16 @@ Next release
Bug Fixes
---------
+- When ``pyramid.wsgi.wsgiapp2`` calls the downstream WSGI app, the
+ app's environ will no longer have (deprecated and potentially misleading)
+ ``bfg.routes.matchdict`` or ``bfg.routes.route`` keys in it.
+
+1.3b3 (2012-03-17)
+==================
+
+Bug Fixes
+---------
+
- ``config.add_view(<aninstancemethod>)`` raised AttributeError involving
``__text__``. See https://github.com/Pylons/pyramid/issues/461
diff --git a/docs/conf.py b/docs/conf.py
index 1c957162e..d694b2151 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -80,7 +80,7 @@ copyright = '%s, Agendaless Consulting' % datetime.datetime.now().year
# other places throughout the built documents.
#
# The short X.Y version.
-version = '1.3b2'
+version = '1.3b3'
# The full version, including alpha/beta/rc tags.
release = version
diff --git a/docs/python-3.png b/docs/python-3.png
new file mode 100644
index 000000000..46ecd8581
--- /dev/null
+++ b/docs/python-3.png
Binary files differ
diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst
index 85bb26ba5..b4138be13 100644
--- a/docs/whatsnew-1.3.rst
+++ b/docs/whatsnew-1.3.rst
@@ -15,6 +15,8 @@ The major feature additions in Pyramid 1.3 follow.
Python 3 Compatibility
~~~~~~~~~~~~~~~~~~~~~~
+.. image:: python-3.png
+
Pyramid continues to run on Python 2, but Pyramid is now also Python 3
compatible. To use Pyramid under Python 3, Python 3.2 or better is required.
diff --git a/pyramid/request.py b/pyramid/request.py
index af1dfee2b..37fac6a46 100644
--- a/pyramid/request.py
+++ b/pyramid/request.py
@@ -453,4 +453,14 @@ def call_app_with_subpath_as_path_info(request, app):
new_request = request.copy()
new_request.environ['SCRIPT_NAME'] = new_script_name
new_request.environ['PATH_INFO'] = new_path_info
+
+ # In case downstream WSGI app is a Pyramid app, hack around existence of
+ # these envars until we can safely remove them (see router.py); in any
+ # case, even if these get removed, it might be better to not copy the
+ # existing environ but to create a new one instead.
+ if 'bfg.routes.route' in new_request.environ:
+ del new_request.environ['bfg.routes.route']
+ if 'bfg.routes.matchdict' in new_request.environ:
+ del new_request.environ['bfg.routes.matchdict']
+
return new_request.get_response(app)
diff --git a/pyramid/tests/test_request.py b/pyramid/tests/test_request.py
index 170ea5c97..6d5131013 100644
--- a/pyramid/tests/test_request.py
+++ b/pyramid/tests/test_request.py
@@ -546,6 +546,18 @@ class Test_call_app_with_subpath_as_path_info(unittest.TestCase):
self.assertEqual(request.environ['SCRIPT_NAME'], '/' + encoded)
self.assertEqual(request.environ['PATH_INFO'], '/' + encoded)
+ def test_it_removes_bfg_routes_info(self):
+ request = DummyRequest({})
+ request.environ['bfg.routes.route'] = True
+ request.environ['bfg.routes.matchdict'] = True
+ response = self._callFUT(request, 'app')
+ self.assertTrue(request.copied)
+ self.assertEqual(response, 'app')
+ self.assertEqual(request.environ['SCRIPT_NAME'], '')
+ self.assertEqual(request.environ['PATH_INFO'], '/')
+ self.assertFalse('bfg.routes.route' in request.environ)
+ self.assertFalse('bfg.routes.matchdict' in request.environ)
+
class DummyRequest:
def __init__(self, environ=None):
if environ is None:
diff --git a/setup.py b/setup.py
index 45f556e67..d04fbed3a 100644
--- a/setup.py
+++ b/setup.py
@@ -64,7 +64,7 @@ if not PY3:
testing_extras = tests_require + ['nose', 'coverage']
setup(name='pyramid',
- version='1.3b2',
+ version='1.3b3',
description=('The Pyramid web application development framework, a '
'Pylons project'),
long_description=README + '\n\n' + CHANGES,