diff options
| author | Randall Leeds <randall@bleeds.info> | 2014-07-10 16:31:31 -0700 |
|---|---|---|
| committer | Randall Leeds <randall@bleeds.info> | 2014-11-11 00:46:05 -0800 |
| commit | e7745ac72ff5c5c499722a8cfcc589a77201fc9a (patch) | |
| tree | 7497a5041112b106c97a00918c7df3e55d809dc9 | |
| parent | 940a7a3e3a254ba3b5db333f2a07ab43f5018d98 (diff) | |
| download | pyramid-e7745ac72ff5c5c499722a8cfcc589a77201fc9a.tar.gz pyramid-e7745ac72ff5c5c499722a8cfcc589a77201fc9a.tar.bz2 pyramid-e7745ac72ff5c5c499722a8cfcc589a77201fc9a.zip | |
Fix static views with package root spec patterns
| -rw-r--r-- | CHANGES.txt | 3 | ||||
| -rw-r--r-- | pyramid/config/views.py | 2 | ||||
| -rw-r--r-- | pyramid/tests/test_config/test_views.py | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index b5d08c8ff..5a0edc566 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -67,6 +67,9 @@ Bug Fixes - Fix a failing unittest caused by differing mimetypes across various OSs. See https://github.com/Pylons/pyramid/issues/1405 +- Fix route generation for static view asset specifications having no path. + See https://github.com/Pylons/pyramid/pull/1377 + Docs ---- diff --git a/pyramid/config/views.py b/pyramid/config/views.py index e4171b0c5..ba3981388 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -1955,7 +1955,7 @@ class StaticURLInfo(object): sep = os.sep else: sep = '/' - if not spec.endswith(sep): + if not spec.endswith(sep) and not spec.endswith(':'): spec = spec + sep # we also make sure the name ends with a slash, purely as a diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py index a82f7f257..b0d03fb72 100644 --- a/pyramid/tests/test_config/test_views.py +++ b/pyramid/tests/test_config/test_views.py @@ -3902,7 +3902,7 @@ class TestStaticURLInfo(unittest.TestCase): inst = self._makeOne() config = self._makeConfig() inst.add(config, 'http://example.com', 'package:') - expected = [('http://example.com/', 'package:', None)] + expected = [('http://example.com/', 'package:', None, None)] self._assertRegistrations(config, expected) def test_add_url_withendslash(self): |
