summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2015-12-23 02:26:21 -0800
committerSteve Piercy <web@stevepiercy.com>2015-12-23 02:26:21 -0800
commit0e79f827cb8eed8b836e51e72c747aa8b0824d2a (patch)
tree1596fbdaf7137182a754646203caa46922dfef71
parent35a479e008e4b09a61864cb3936257975b412ec9 (diff)
parent7593b05e4b4bd0bc85c5f46964b4e4a55286ad49 (diff)
downloadpyramid-0e79f827cb8eed8b836e51e72c747aa8b0824d2a.tar.gz
pyramid-0e79f827cb8eed8b836e51e72c747aa8b0824d2a.tar.bz2
pyramid-0e79f827cb8eed8b836e51e72c747aa8b0824d2a.zip
Merge branch 'master' of https://github.com/Pylons/pyramid
-rw-r--r--CHANGES.txt10
-rw-r--r--pyramid/path.py3
-rw-r--r--pyramid/scripts/pserve.py14
3 files changed, 21 insertions, 6 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 3c3dd6e79..32c4995b8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -252,13 +252,21 @@ Bug Fixes
process failed to fork because it could not find the pserve script to
run. See https://github.com/Pylons/pyramid/pull/2137
+- Ensure that ``IAssetDescriptor.abspath`` always returns an absolute path.
+ There were cases depending on the process CWD that a relative path would
+ be returned. See https://github.com/Pylons/pyramid/issues/2187
+
+
Deprecations
------------
- The ``pserve`` command's daemonization features have been deprecated as well
as ``--monitor-restart``. This includes the ``[start,stop,restart,status]``
subcommands as well as the ``--daemon``, ``--stop-daemon``, ``--pid-file``,
- and ``--status`` flags.
+ ``--status``, ``--user`` and ``--group`` flags.
+ See https://github.com/Pylons/pyramid/pull/2120
+ and https://github.com/Pylons/pyramid/pull/2189
+ and https://github.com/Pylons/pyramid/pull/1641
Please use a real process manager in the future instead of relying on the
``pserve`` to daemonize itself. Many options exist including your Operating
diff --git a/pyramid/path.py b/pyramid/path.py
index b79c5a6ac..ceb0a0cf3 100644
--- a/pyramid/path.py
+++ b/pyramid/path.py
@@ -396,7 +396,8 @@ class PkgResourcesAssetDescriptor(object):
return '%s:%s' % (self.pkg_name, self.path)
def abspath(self):
- return self.pkg_resources.resource_filename(self.pkg_name, self.path)
+ return os.path.abspath(
+ self.pkg_resources.resource_filename(self.pkg_name, self.path))
def stream(self):
return self.pkg_resources.resource_stream(self.pkg_name, self.path)
diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py
index 95752a3be..5aaaffec9 100644
--- a/pyramid/scripts/pserve.py
+++ b/pyramid/scripts/pserve.py
@@ -212,8 +212,9 @@ class PServeCommand(object):
self.options.set_user = self.options.set_group = None
# @@: Is this the right stage to set the user at?
- self.change_user_group(
- self.options.set_user, self.options.set_group)
+ if self.options.set_user or self.options.set_group:
+ self.change_user_group(
+ self.options.set_user, self.options.set_group)
if not self.args:
self.out('You must give a config file')
@@ -624,11 +625,16 @@ a real process manager for your processes like Systemd, Circus, or Supervisor.
self.out('%s %s %s' % ('-' * 20, 'Restarting', '-' * 20))
def change_user_group(self, user, group): # pragma: no cover
- if not user and not group:
- return
import pwd
import grp
+ self.out('''\
+The --user and --group options have been deprecated in Pyramid 1.6. They will
+be removed in a future release per Pyramid's deprecation policy. Please
+consider using a real process manager for your processes like Systemd, Circus,
+or Supervisor, all of which support process security.
+''')
+
uid = gid = None
if group:
try: