summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2015-12-17 23:32:28 -0600
committerMichael Merickel <michael@merickel.org>2015-12-17 23:32:28 -0600
commit70551f752aaa238ecb9d3cbe3f00ccc458f3db7a (patch)
tree50b15ec3a0cb10f1687a38c75168a97bc9205238
parentb791e9ee69e98032950f97e09a98baadddbe9f91 (diff)
parent010218070ef62a31e3880acf2994ea217797332a (diff)
downloadpyramid-70551f752aaa238ecb9d3cbe3f00ccc458f3db7a.tar.gz
pyramid-70551f752aaa238ecb9d3cbe3f00ccc458f3db7a.tar.bz2
pyramid-70551f752aaa238ecb9d3cbe3f00ccc458f3db7a.zip
Merge pull request #2187 from mmerickel/fix/asset-abspath
ensure IAssetDescriptor.abspath always returns an abspath
-rw-r--r--CHANGES.txt5
-rw-r--r--pyramid/path.py3
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 3c3dd6e79..0f88a95da 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -252,6 +252,11 @@ 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
------------
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)