Use abspath for gallery.py's base path.
authorW. Trevor King <wking@tremily.us>
Sat, 7 Jul 2012 04:07:36 +0000 (00:07 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 7 Jul 2012 04:07:36 +0000 (00:07 -0400)
Otherwise the base path is ignored when os.path.join() is used to
connect it with a URL that starts with a slash.

posts/gallery/gallery.py

index 1f9ad62276edb2eb223ade6318413df46c3020fb..a5354fc67ca7274a1045ac46743952cbcc173561 100755 (executable)
@@ -126,7 +126,7 @@ class CGIGalleryServer (object):
     def __init__(self, base_path='/var/www/localhost/htdocs/gallery/',
                  base_url='/cgi-bin/gallery.py',
                  cache_path='/tmp/gallery-cache/'):
-        self._base_path = base_path
+        self._base_path = _os_path.abspath(base_path)
         self._base_url = base_url
         self._cache_path = cache_path
         self._url_regexp = _re.compile('^[a-z0-9._/-]*$')