Commit ad248b12 authored by TANIGUCHI Takaki's avatar TANIGUCHI Takaki

New upstream version 1.10.2+dfsg

parent dc684435
.. _changes_1.10.2:
1.10.2 (2019-01-30)
===================
- Fix a bug in ``pyramid.testing.DummySecurityPolicy`` in which
``principals_allows_by_permission`` would return all principals instead
of an empty list if ``permissive`` is ``False``.
See https://github.com/Pylons/pyramid/pull/3450
- Fix a bug in which ``pyramid.exceptions.ConfigurationConflictError`` may
not render the appropriate error message on certain conflicts that were
not sortable on Python 3 due to differing types.
See https://github.com/Pylons/pyramid/pull/3457
- Avoid configuring logging in the monitor process usin the logging config
intended for the application. This avoids opening files for writing in both
processes which can cause issues on some systems.
See https://github.com/Pylons/pyramid/pull/3460
.. _changes_1.10.1:
1.10.1 (2018-11-06)
......@@ -16,9 +36,6 @@
1.10b1 (2018-10-28)
===================
Bug Fixes
---------
- Fix the ``pyramid.testing.DummyRequest`` to support the new
``request.accept`` API so that ``acceptable_offers`` is available even
when code sets the value to a string.
......
Metadata-Version: 2.1
Name: pyramid
Version: 1.10.1
Version: 1.10.2
Summary: The Pyramid Web Framework, a Pylons project
Home-page: https://trypyramid.com
Author: Chris McDonough, Agendaless Consulting
Author-email: pylons-discuss@googlegroups.com
License: BSD-derived (http://www.repoze.org/LICENSE.txt)
Project-URL: Documentation, https://docs.pylonsproject.org/projects/pyramid/en/1.10.1-branch/
Project-URL: Changelog, https://docs.pylonsproject.org/projects/pyramid/en/1.10.1-branch/whatsnew-1.10.1.html
Project-URL: Documentation, https://docs.pylonsproject.org/projects/pyramid/en/1.10.2-branch/
Project-URL: Changelog, https://docs.pylonsproject.org/projects/pyramid/en/1.10.2-branch/whatsnew-1.10.2.html
Project-URL: Issue Tracker, https://github.com/Pylons/pyramid/issues
Description: Pyramid
=======
......@@ -76,6 +76,26 @@ Description: Pyramid
<https://github.com/Pylons/pyramid/graphs/contributors>`_.
.. _changes_1.10.2:
1.10.2 (2019-01-30)
===================
- Fix a bug in ``pyramid.testing.DummySecurityPolicy`` in which
``principals_allows_by_permission`` would return all principals instead
of an empty list if ``permissive`` is ``False``.
See https://github.com/Pylons/pyramid/pull/3450
- Fix a bug in which ``pyramid.exceptions.ConfigurationConflictError`` may
not render the appropriate error message on certain conflicts that were
not sortable on Python 3 due to differing types.
See https://github.com/Pylons/pyramid/pull/3457
- Avoid configuring logging in the monitor process usin the logging config
intended for the application. This avoids opening files for writing in both
processes which can cause issues on some systems.
See https://github.com/Pylons/pyramid/pull/3460
.. _changes_1.10.1:
1.10.1 (2018-11-06)
......@@ -94,9 +114,6 @@ Description: Pyramid
1.10b1 (2018-10-28)
===================
Bug Fixes
---------
- Fix the ``pyramid.testing.DummyRequest`` to support the new
``request.accept`` API so that ``acceptable_offers`` is available even
when code sets the value to a string.
......
......@@ -23,7 +23,7 @@ def readfile(name):
README = readfile('README.rst')
CHANGES = readfile('CHANGES.rst')
VERSION = '1.10.1'
VERSION = '1.10.2'
install_requires = [
'hupper',
......
Metadata-Version: 2.1
Name: pyramid
Version: 1.10.1
Version: 1.10.2
Summary: The Pyramid Web Framework, a Pylons project
Home-page: https://trypyramid.com
Author: Chris McDonough, Agendaless Consulting
Author-email: pylons-discuss@googlegroups.com
License: BSD-derived (http://www.repoze.org/LICENSE.txt)
Project-URL: Documentation, https://docs.pylonsproject.org/projects/pyramid/en/1.10.1-branch/
Project-URL: Changelog, https://docs.pylonsproject.org/projects/pyramid/en/1.10.1-branch/whatsnew-1.10.1.html
Project-URL: Documentation, https://docs.pylonsproject.org/projects/pyramid/en/1.10.2-branch/
Project-URL: Changelog, https://docs.pylonsproject.org/projects/pyramid/en/1.10.2-branch/whatsnew-1.10.2.html
Project-URL: Issue Tracker, https://github.com/Pylons/pyramid/issues
Description: Pyramid
=======
......@@ -76,6 +76,26 @@ Description: Pyramid
<https://github.com/Pylons/pyramid/graphs/contributors>`_.
.. _changes_1.10.2:
1.10.2 (2019-01-30)
===================
- Fix a bug in ``pyramid.testing.DummySecurityPolicy`` in which
``principals_allows_by_permission`` would return all principals instead
of an empty list if ``permissive`` is ``False``.
See https://github.com/Pylons/pyramid/pull/3450
- Fix a bug in which ``pyramid.exceptions.ConfigurationConflictError`` may
not render the appropriate error message on certain conflicts that were
not sortable on Python 3 due to differing types.
See https://github.com/Pylons/pyramid/pull/3457
- Avoid configuring logging in the monitor process usin the logging config
intended for the application. This avoids opening files for writing in both
processes which can cause issues on some systems.
See https://github.com/Pylons/pyramid/pull/3460
.. _changes_1.10.1:
1.10.1 (2018-11-06)
......@@ -94,9 +114,6 @@ Description: Pyramid
1.10b1 (2018-10-28)
===================
Bug Fixes
---------
- Fix the ``pyramid.testing.DummyRequest`` to support the new
``request.accept`` API so that ``acceptable_offers`` is available even
when code sets the value to a string.
......
......@@ -3,8 +3,6 @@ from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPForbidden
NotFound = HTTPNotFound # bw compat
Forbidden = HTTPForbidden # bw compat
CR = '\n'
class BadCSRFOrigin(HTTPBadRequest):
"""
......@@ -92,14 +90,13 @@ class ConfigurationConflictError(ConfigurationError):
def __str__(self):
r = ["Conflicting configuration actions"]
items = sorted(self._conflicts.items())
for discriminator, infos in items:
for discriminator, infos in self._conflicts.items():
r.append(" For: %s" % (discriminator,))
for info in infos:
for line in str(info).rstrip().split(CR):
for line in str(info).rstrip().split('\n'):
r.append(" " + line)
return CR.join(r)
return '\n'.join(r)
class ConfigurationExecutionError(ConfigurationError):
......
......@@ -184,7 +184,11 @@ class PServeCommand(object):
app_name = self.args.app_name
loader = self._get_config_loader(config_uri)
loader.setup_logging(config_vars)
# setup logging only in the worker process incase the logging config
# opens files which should not be opened by multiple processes at once
if not self.args.reload or hupper.is_active():
loader.setup_logging(config_vars)
self.pserve_file_config(loader, global_conf=config_vars)
......
......@@ -91,7 +91,10 @@ class DummySecurityPolicy(object):
return self.permissive
def principals_allowed_by_permission(self, context, permission):
return self.effective_principals(None)
if self.permissive:
return self.effective_principals(None)
else:
return []
class DummyTemplateRenderer(object):
......
from collections import OrderedDict
import unittest
......@@ -72,7 +73,9 @@ class TestConfigurationConflictError(unittest.TestCase):
return ConfigurationConflictError(conflicts)
def test_str(self):
conflicts = {'a': ('1', '2', '3'), 'b': ('4', '5', '6')}
conflicts = OrderedDict()
conflicts['a'] = ('1', '2', '3')
conflicts['b'] = ('4', '5', '6')
exc = self._makeOne(conflicts)
self.assertEqual(
str(exc),
......@@ -88,6 +91,25 @@ Conflicting configuration actions
6""",
)
def test_non_sortable_discriminators_in_str(self):
conflicts = OrderedDict()
conflicts['a'] = ('1', '2', '3')
conflicts[None] = ('4', '5', '6')
exc = self._makeOne(conflicts)
self.assertEqual(
str(exc),
"""\
Conflicting configuration actions
For: a
1
2
3
For: None
4
5
6""",
)
class TestConfigurationExecutionError(unittest.TestCase):
def _makeOne(self, etype, evalue, info):
......
......@@ -63,6 +63,13 @@ class TestDummySecurityPolicy(unittest.TestCase):
result = policy.principals_allowed_by_permission(None, None)
self.assertEqual(result, [Everyone, Authenticated, 'user', 'group1'])
def test_principals_allowed_by_permission_not_permissive(self):
policy = self._makeOne('user', ('group1',))
policy.permissive = False
result = policy.principals_allowed_by_permission(None, None)
self.assertEqual(result, [])
def test_forget(self):
policy = self._makeOne()
self.assertEqual(policy.forget(None), [])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment