You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by gr...@apache.org on 2006/12/02 07:18:20 UTC

svn commit: r481507 - in /httpd/mod_python/trunk: lib/python/mod_python/__init__.py lib/python/mod_python/importer.py src/include/mpversion.h

Author: grahamd
Date: Fri Dec  1 22:18:17 2006
New Revision: 481507

URL: http://svn.apache.org/viewvc?view=rev&rev=481507
Log:
(MODPYTHON-143) Have the handler root fallback to be the document root when
handler directives are used in Location directive or in root context of
VirtualHost or actual server. This handler root is what is used as the
first place to look for a module when using apache.import_module() or when
it is necessary to expand a path prefixed by '~/'.


Modified:
    httpd/mod_python/trunk/lib/python/mod_python/__init__.py
    httpd/mod_python/trunk/lib/python/mod_python/importer.py
    httpd/mod_python/trunk/src/include/mpversion.h

Modified: httpd/mod_python/trunk/lib/python/mod_python/__init__.py
URL: http://svn.apache.org/viewvc/httpd/mod_python/trunk/lib/python/mod_python/__init__.py?view=diff&rev=481507&r1=481506&r2=481507
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/__init__.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/__init__.py Fri Dec  1 22:18:17 2006
@@ -20,5 +20,5 @@
 __all__ = ["apache", "cgihandler", "psp",
            "publisher", "util", "python22"]
 
-version = "3.3.0-dev-20061123"
+version = "3.3.0-dev-20061202"
 

Modified: httpd/mod_python/trunk/lib/python/mod_python/importer.py
URL: http://svn.apache.org/viewvc/httpd/mod_python/trunk/lib/python/mod_python/importer.py?view=diff&rev=481507&r1=481506&r2=481507
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/importer.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/importer.py Fri Dec  1 22:18:17 2006
@@ -1351,6 +1351,13 @@
                         break
                     parent = parent.parent
 
+            # If directory for filter still not
+            # able to be determined, use the server
+            # document root.
+
+            if directory is None:
+                directory = filter.req.document_root()
+
             # Expand relative addressing shortcuts.
 
             if type(handler) == types.StringType:
@@ -1469,6 +1476,12 @@
             root = parent.directory
             parent = parent.parent
 
+	# If directory for handler still not able to be
+	# determined, use the server document root.
+
+        if root is None:
+            root = req.document_root()
+
         # Iterate over the handlers defined for the
         # current phase and execute each in turn
         # until the last is reached or prematurely
@@ -1752,6 +1765,11 @@
                     location = context.location
                     directory = context.directory
 
+                hostname = req.server.server_hostname
+                root = req.document_root()
+
+                log_error('ServerName: %s' % `hostname`, flags)
+                log_error('DocumentRoot: %s' % `root`, flags)
                 log_error('URI: %s' % `req.uri`, flags)
                 log_error('Location: %s' % `location`, flags)
                 log_error('Directory: %s' % `directory`, flags)
@@ -1779,6 +1797,9 @@
             print >> output, 'Interpreter:    %s' % `iname`
 
             if req:
+                print >> output
+                print >> output, 'ServerName:     %s' % `hostname`
+                print >> output, 'DocumentRoot:   %s' % `root`
                 print >> output
                 print >> output, 'URI:            %s' % `req.uri`
                 print >> output, 'Location:       %s' % `location`

Modified: httpd/mod_python/trunk/src/include/mpversion.h
URL: http://svn.apache.org/viewvc/httpd/mod_python/trunk/src/include/mpversion.h?view=diff&rev=481507&r1=481506&r2=481507
==============================================================================
--- httpd/mod_python/trunk/src/include/mpversion.h (original)
+++ httpd/mod_python/trunk/src/include/mpversion.h Fri Dec  1 22:18:17 2006
@@ -1,5 +1,5 @@
 #define MPV_MAJOR 3
 #define MPV_MINOR 3
 #define MPV_PATCH 0
-#define MPV_BUILD 20061123
-#define MPV_STRING "3.3.0-dev-20061123"
+#define MPV_BUILD 20061202
+#define MPV_STRING "3.3.0-dev-20061202"