From 58d14988ca00ceda3764970a041f7e8c1d9b8501 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 17 Mar 2012 17:49:42 -0400 Subject: prep for 1.3b3 --- CHANGES.txt | 4 ++-- docs/conf.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f12e98a8b..f673143cd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ -Next release -============ +1.3b3 (2012-03-17) +================== Bug Fixes --------- 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/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, -- cgit v1.2.3 From 369918ca04344e91549b767254cd588a80cfbe1e Mon Sep 17 00:00:00 2001 From: Rachid Belaid Date: Sat, 17 Mar 2012 22:32:11 +0000 Subject: misspelling : change 'pryamid_debugtoolbar' into 'pyramid_debugtoolbar' --- docs/narr/project.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 96ea8036c..b9b381cdf 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -370,7 +370,7 @@ Put a hash mark at the beginning of the ``pyramid_debugtoolbar`` line: Then restart the application to see that the toolbar has been turned off. -Note that if you comment out the ``pryamid_debugtoolbar`` line, the ``#`` +Note that if you comment out the ``pyramid_debugtoolbar`` line, the ``#`` *must* be in the first column. If you put the hash mark anywhere except the first column instead, for example like this: -- cgit v1.2.3 From 29fe4e6bbc08ce015ebc8e3e221ab02301bc1414 Mon Sep 17 00:00:00 2001 From: Rachid Belaid Date: Sun, 18 Mar 2012 04:01:52 +0000 Subject: Keep the same notation, 'myproject' is used previously. 'mypackage' is correct and generic, after following the previous step of the documentation the user would have only one package which is 'myproject' --- docs/narr/project.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/narr/project.rst b/docs/narr/project.rst index b9b381cdf..f6790e863 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -750,8 +750,8 @@ also informs Python that the directory which contains it is a *package*. Line 6 creates an instance of a :term:`Configurator`. Line 7 registers a static view, which will serve up the files from the - ``mypackage:static`` :term:`asset specification` (the ``static`` - directory of the ``mypackage`` package). + ``myproject:static`` :term:`asset specification` (the ``static`` + directory of the ``myproject`` package). Line 8 adds a :term:`route` to the configuration. This route is later used by a view in the ``views`` module. -- cgit v1.2.3 From 5e861a0a4baac0005b8800d7e31524dcc1d0aeb8 Mon Sep 17 00:00:00 2001 From: Rachid Belaid Date: Sun, 18 Mar 2012 04:20:11 +0000 Subject: Keep the same vocabulary than previously in the doc, at this stage of the instruction the user doesn't have more than one package which myproject --- docs/narr/project.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/narr/project.rst b/docs/narr/project.rst index f6790e863..2ab466af2 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -888,7 +888,7 @@ If your project package name was ``myproject`` and you wanted to arrange all your views in a Python subpackage within the ``myproject`` :term:`package` named ``views`` instead of within a single ``views.py`` file, you might: -- Create a ``views`` directory inside your ``mypackage`` package directory +- Create a ``views`` directory inside your ``myproject`` package directory (the same directory which holds ``views.py``). - *Move* the existing ``views.py`` file to a file inside the new ``views`` -- cgit v1.2.3 From 8b289f9db4120bb918ebbec3fdd8d59a3092fc96 Mon Sep 17 00:00:00 2001 From: Rachid Belaid Date: Sun, 18 Mar 2012 04:36:56 +0000 Subject: Suggestion : giving at least the name the command to use as an indication . Even if this information it's not enough, when you read the doc via pdf that give you which command to use without having to jump of section. I find it better for the learning flow of the reader than jumping around. --- docs/narr/project.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 2ab466af2..63d9432f1 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -908,7 +908,7 @@ is restarted. Using the Interactive Shell --------------------------- -It is possible to use a Python interpreter prompt loaded with a similar +It is possible to use the ``pshell`` command to load a Python interpreter prompt with a similar configuration as would be loaded if you were running your Pyramid application via ``pserve``. This can be a useful debugging tool. See :ref:`interactive_shell` for more details. -- cgit v1.2.3 From 8da11954e3ac7211c3f5b30472f0fdea0ef75e2f Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sun, 18 Mar 2012 02:11:56 -0500 Subject: Fixed line width. --- docs/narr/project.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 63d9432f1..318d932fe 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -908,10 +908,10 @@ is restarted. Using the Interactive Shell --------------------------- -It is possible to use the ``pshell`` command to load a Python interpreter prompt with a similar -configuration as would be loaded if you were running your Pyramid application -via ``pserve``. This can be a useful debugging tool. See -:ref:`interactive_shell` for more details. +It is possible to use the ``pshell`` command to load a Python interpreter +prompt with a similar configuration as would be loaded if you were running +your Pyramid application via ``pserve``. This can be a useful debugging tool. +See :ref:`interactive_shell` for more details. What Is This ``pserve`` Thing ----------------------------- -- cgit v1.2.3 From 53c242ee3a05eaf9eef7650611c268546e60ebaf Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 18 Mar 2012 17:38:50 -0400 Subject: add python 3 logo --- docs/python-3.png | Bin 0 -> 8858 bytes docs/whatsnew-1.3.rst | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 docs/python-3.png diff --git a/docs/python-3.png b/docs/python-3.png new file mode 100644 index 000000000..46ecd8581 Binary files /dev/null and b/docs/python-3.png 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. -- cgit v1.2.3 From 2b41345e815c2e584fd51bbe534ba35e222f3b80 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 18 Mar 2012 18:09:44 -0400 Subject: - 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. --- CHANGES.txt | 10 ++++++++++ pyramid/request.py | 10 ++++++++++ pyramid/tests/test_request.py | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index f673143cd..d52c8d479 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,13 @@ +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) ================== 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: -- cgit v1.2.3