summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2008-05-29 15:46:32 +0000
committerianb <devnull@localhost>2008-05-29 15:46:32 +0000
commitee790b8d10e775dc345bf19be1e90fc7a656857d (patch)
tree6c8f3d9e0b807ba367184c004b4b504b0830aa17
parent42b55c956e00ef0396e299ac4e44ba98187c3619 (diff)
downloadpaste-ee790b8d10e775dc345bf19be1e90fc7a656857d.tar.gz
normalize/make-absolute the paths passed into StaticURLParser
-rw-r--r--docs/news.txt7
-rw-r--r--paste/urlparser.py2
2 files changed, 8 insertions, 1 deletions
diff --git a/docs/news.txt b/docs/news.txt
index 8bf3ed6..cb0ec15 100644
--- a/docs/news.txt
+++ b/docs/news.txt
@@ -3,6 +3,13 @@ News
.. contents::
+svn trunk
+---------
+
+* Normalize and make absolute the paths passed to
+ :class:`paste.urlparser.StaticURLParser` (before passing a
+ relative-to-cwd path to that class would cause Forbidden errors).
+
1.7
---
diff --git a/paste/urlparser.py b/paste/urlparser.py
index 530e9c4..a8268d5 100644
--- a/paste/urlparser.py
+++ b/paste/urlparser.py
@@ -432,7 +432,7 @@ class StaticURLParser(object):
cache_max_age=None):
if os.path.sep != '/':
directory = directory.replace(os.path.sep, '/')
- self.directory = directory
+ self.directory = os.path.normcase(os.path.abspath(directory))
self.root_directory = root_directory
if root_directory is not None:
self.root_directory = os.path.normpath(self.root_directory)