Steve Piercy
2014-11-10 370b93ceadfa8a5de34024762d68d7b7695f6083
Merge pull request #1440 from stevepiercy/1.5-branch

backports from master to 1.5 branch
24 files modified
678 ■■■■■ changed files
CHANGES.txt 19 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/authentication/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/authorization/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/databases/development.ini 36 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/debugtoolbar.rst 43 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/debugtoolbar/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/forms/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/functional_testing/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/ini/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/jinja2/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/json.rst 2 ●●● patch | view | raw | blame | history
docs/quick_tutorial/json/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/more_view_classes/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/request_response/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/requirements.rst 12 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/retail_forms/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/routing/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/sessions/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/static_assets/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/templating/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/unit_testing/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/view_classes/development.ini 31 ●●●●● patch | view | raw | blame | history
docs/quick_tutorial/views/development.ini 31 ●●●●● patch | view | raw | blame | history
pyramid/interfaces.py 8 ●●●● patch | view | raw | blame | history
CHANGES.txt
@@ -1,6 +1,19 @@
Next release
============
Docs
----
- Removed logging configuration from Quick Tutorial ini files except for
  scaffolding- and logging-related chapters to avoid needing to explain it too
  early.
- Clarify a previously-implied detail of the ``ISession.invalidate`` API
  documentation.
Bug Fixes
---------
- Work around a bug introduced in Python 2.7.7 on Windows where
  ``mimetypes.guess_type`` returns Unicode rather than str for the content
  type, unlike any previous version of Python.  See
@@ -16,13 +29,15 @@
- Fix an issue whereby predicates would be resolved as maybe_dotted in the
  introspectable but not when passed for registration. This would mean that
  add_route_predicate for example can not take a string and turn it into the
  actual callable function.
  ``add_route_predicate`` for example can not take a string and turn it into
  the actual callable function.
  See https://github.com/Pylons/pyramid/pull/1306
- Fix ``pyramid.testing.setUp`` to return a ``Configurator`` with a proper
  package. Previously it was not possible to do package-relative includes
  using the returned ``Configurator`` during testing. There is now a
  ``package`` argument that can override this behavior as well.
  See https://github.com/Pylons/pyramid/pull/1322
- Removed non-ascii copyright symbol from templates, as this was
  causing the scaffolds to fail for project generation on some systems.
docs/quick_tutorial/authentication/development.ini
@@ -9,34 +9,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/authorization/development.ini
@@ -9,34 +9,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/databases/development.ini
@@ -11,39 +11,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial, sqlalchemy
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/debugtoolbar.rst
@@ -58,31 +58,30 @@
Analysis
========
``pyramid_debugtoolbar`` is a full-fledged Python package,
available on PyPI just like thousands of other Python packages. Thus we
start by installing the ``pyramid_debugtoolbar`` package into our
virtual environment using normal Python package installation commands.
``pyramid_debugtoolbar`` is a full-fledged Python package, available on PyPI
just like thousands of other Python packages. Thus we start by installing the
``pyramid_debugtoolbar`` package into our virtual environment using normal
Python package installation commands.
The ``pyramid_debugtoolbar`` Python package is also a Pyramid add-on,
which means we need to include its add-on configuration into our web
application. We could do this with imperative configuration in
``tutorial/__init__.py`` by using ``config.include``. Pyramid also
supports wiring in add-on configuration via our ``development.ini``
using ``pyramid.includes``. We use this to load the configuration for
the debugtoolbar.
The ``pyramid_debugtoolbar`` Python package is also a Pyramid add-on, which
means we need to include its add-on configuration into our web application. We
could do this with imperative configuration in ``tutorial/__init__.py`` by
using ``config.include``. Pyramid also supports wiring in add-on configuration
via our ``development.ini`` using ``pyramid.includes``. We use this to load
the configuration for the debugtoolbar.
You'll now see an attractive (and collapsible) menu in the right of
your browser, providing introspective access to debugging information.
Even better, if your web application generates an error,
you will see a nice traceback on the screen. When you want to disable
this toolbar, no need to change code: you can remove it from
``pyramid.includes`` in the relevant ``.ini`` configuration file (thus
showing why configuration files are handy.)
You'll now see an attractive button on the right side of your browser, which
you may click to provide introspective access to debugging information in a
new browser tab. Even better, if your web application generates an error, you
will see a nice traceback on the screen. When you want to disable this
toolbar, no need to change code: you can remove it from ``pyramid.includes``
in the relevant ``.ini`` configuration file (thus showing why configuration
files are handy.)
Note that the toolbar mutates the HTML generated by our app and uses jQuery to
overlay itself.  If you are using the toolbar while you're developing and you
start to experience otherwise inexplicable client-side weirdness, you can shut
it off by commenting out the ``pyramid_debugtoolbar`` line in
Note that the toolbar injects a small amount of html/css into your app just
before the closing ``</body>`` tag in order to display itself. If you start
to experience otherwise inexplicable client-side weirdness, you can shut it
off by commenting out the ``pyramid_debugtoolbar`` line in
``pyramid.includes`` temporarily.
.. seealso:: See also :ref:`pyramid_debugtoolbar <toolbar:overview>`.
docs/quick_tutorial/debugtoolbar/development.ini
@@ -7,34 +7,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/forms/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/functional_testing/development.ini
@@ -7,34 +7,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/ini/development.ini
@@ -5,34 +5,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/jinja2/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/json.rst
@@ -40,7 +40,7 @@
    :linenos:
#. Rather than implement a new view, we will "stack" another decorator
   on the ``hello`` view:
   on the ``hello`` view in ``views.py``:
   .. literalinclude:: json/tutorial/views.py
    :linenos:
docs/quick_tutorial/json/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/more_view_classes/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/request_response/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/requirements.rst
@@ -187,9 +187,15 @@
    $ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | $VENV/bin/python
    # Windows
    # Use your browser to download:
    #   https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.p
    # ...into c:\projects\quick_tutorial\ez_setup.py
    #
    # Use your web browser to download this file:
    #   https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
    #
    # ...and save it to:
    # c:\projects\quick_tutorial\ez_setup.py
    #
    # Then run the following command:
    c:\> %VENV%\Scripts\python ez_setup.py
If ``wget`` complains with a certificate error, then run this command instead:
docs/quick_tutorial/retail_forms/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/routing/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/sessions/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/static_assets/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/templating/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/unit_testing/development.ini
@@ -7,34 +7,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/view_classes/development.ini
@@ -8,34 +8,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
docs/quick_tutorial/views/development.ini
@@ -7,34 +7,3 @@
use = egg:pyramid#wsgiref
host = 0.0.0.0
port = 6543
# Begin logging configuration
[loggers]
keys = root, tutorial
[logger_tutorial]
level = DEBUG
handlers =
qualname = tutorial
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
# End logging configuration
pyramid/interfaces.py
@@ -910,7 +910,13 @@
        ``invalidate`` is implementation-dependent, but it should have
        the effect of completely dissociating any data stored in the
        session with the current request.  It might set response
        values (such as one which clears a cookie), or it might not."""
        values (such as one which clears a cookie), or it might not.
        An invalidated session may be used after the call to ``invalidate``
        with the effect that a new session is created to store the data. This
        enables workflows requiring an entirely new session, such as in the
        case of changing privilege levels or preventing fixation attacks.
        """
    def changed():
        """ Mark the session as changed. A user of a session should