Checkout Tools
  • last updated 7 hours ago
Constraints: committers
Constraints: files
Constraints: dates
Need to normalise paths in sys.path for PythonImport test case as sys.path

is extended with document root which follows Apache forward slash convention

and not operating system backward slash convention when on Windows.

(MODPYTHON-125) When assigning to req.handler, should allow it to be set

to None to reset it.

  1. … 3 more files in changeset.
(MODPYTHON-196) Added log_error() methods to server and connection objects.

Also removed some unused variables which were causing compiler warnings.

  1. … 8 more files in changeset.
(MODPYTHON-187) Table objects could crash in various ways when the value of

an item was NULL. This could occur for SCRIPT_FILENAME when the

req.subprocess_env table was accessed in the post read request handler


  1. … 2 more files in changeset.
(MODPYTHON-171) Reverted changes which resulted in automatic normalisation

of path assigned to req.filename. This is because req.filename is sometimes

used to pass values which isn't strictly a path between handlers. For example

when setting up proxy-server module. Doing normalisation in this case would

thus cause these handlers to fail as extraneous leading slash could be

added to req.filename.

  1. … 3 more files in changeset.
(MODPYTHON-171) When a pathname is assigned to req.filename, the pathname

will be normalised with the result being a POSIX style pathname as required

by Apache.

  1. … 4 more files in changeset.
Added support such that when using req.register_input_filter(),

req.register_output_filter() and req.add_handler() it is now possible to

supply directly a callable object to be used as well as the existing

string reference identifying the module/function to be called. (MODPYTHON-164)

  1. … 17 more files in changeset.
Fix + unit test for #MODPYTHON-179.
  1. … 5 more files in changeset.
Make phase status test more resiliant to strange httpd build

configurations. On some platforms authz handler phase was being called when

it wasn't expected that it would be called.

  1. … 1 more file in changeset.
Directory argument supplied to req.add_handler() is canonicalized and a

trailing slash added automatically. This is needed to ensure that the

directory is always in POSIX path style as used by Apache and that

convention where directories associated with directives always have

trailing slash is adhered to. If this is not done, a different interpreter

can be chosen to that expected when the PythonInterpPerDirective is used.

The same sort of modification was also made for the directory argument

of the req.register_input_filter() and req.register_output_filter()

functions. (MODPYTHON-161) (MODPYTHON-103)

  1. … 5 more files in changeset.
When specifying multiple handlers for phases other than the content phase

as defined by PythonHandler, the status returned by each handler is now

treated the same as how Apache would treat the status if the handler was

registered using the low level C API. What this means is that whereas

previously stacked handlers of any phase would in turn be executed as long

as they returned apache.OK, this is no longer the case and now only occurs

for PythonHandler. What happens for other phases is dependent on the phase,

but in all cases, a handler returning apache.DECLINED no longer causes the

execution of subsequent handlers for the phase to be skipped. Instead, it

will move to the next of the stacked handlers. In the case of

PythonTransHandler, PythonAuthenHandler, PythonAuthzHandler and

PythonTypeHandler, as soon as apache.OK is returned, subsequent handlers

for the phase will be skipped, as the result indicates that any processing

pertinent to that phase has been completed. For other phases, stacked

handlers will continue to be executed if apache.OK is returned as well as

when apache.DECLINED is returned. (MODPYTHON-129)

  1. … 6 more files in changeset.
When using stacked handlers and a SERVER_RETURN exception was used to

return an OK status for that handler, any following handlers weren't being

run if appropriate for the phase. (MODPYTHON-100)

The change was backported from new module importer which already included

the fix, to existing importer.

  1. … 5 more files in changeset.
Force an exception when handler evaluates to something other than None but

is otherwise not callable. Previously an exception would not be generated

if the handler evaluated to False. (MODPYTHON-101)

  1. … 3 more files in changeset.
When Python*Handler or Python*Filter directive is used inside of a Files

directive container, the handler/filter directory value will now correctly

resolve to the directory corresponding to any parent Directory directive or

the location of the .htaccess file the Files directive is contained in.


The patch also lays the ground work for being able to support Directory

directive with glob style wildcards or Directory/DirectoryMatch directive

with a regular expression. (MODPYTHON-63)

  1. … 9 more files in changeset.
Using PythonInterpPerDirective when setting content handler to

run dynamically with req.add_handler() would cause Apache to

crash. (MODPYTHON-160)

  1. … 5 more files in changeset.
Restructure req_requires test to avoid need for AuthBasicAuthoritative

directive just for Apache 2.2. Also introduce authz phase to req_auth_type

test to eliminate possibility that not having it when Requires directive

is used causes complaints from Apache 2.2.

  1. … 2 more files in changeset.
Wrong interpreter name used for fixup handler phase and earlier, when

PythonInterpPerDirectory was enabled and request was against a directory

but client didn't provide the trailing slash. (MODPYTHON-157)

  1. … 5 more files in changeset.
Added req.discard_request_body() function as wrapper for similar function

provided by Apache C API. The function tests for and reads any message body

in the request, simply discarding whatever it receives. (MODPYTHON-153)

  1. … 6 more files in changeset.
Fixes to test suite so it will work on virtual hosting environments

where localhost doesn't resolve to but the actual IP address

of the host. (MODPYTHON-120) (MODPYTHON-121)

  1. … 2 more files in changeset.
Added new experimental module importer. New module importer does not run

by default but must be enabled explicitly. (MODPYTHON-143)

  1. … 5 more files in changeset.
Added req.set_etag(), req.set_last_modified() and req.update_mtime()

functions as wrappers for similar functions provided by Apache C API.


  1. … 4 more files in changeset.
Added the filetype attribute of the Apache finfo structure to the tuple

returned when accessing req.finfo. This value is accessed using

req.finfo[apache.FINFO_FILETYPE]. New constants apache.APR_NOFILE,

apache.APR_REG, apache.APR_DIR etc, have been added for comparing with the

filetype value. (MODPYTHON-128)

  1. … 5 more files in changeset.
Fixed race conditions on setting sys.path when the PythonPath directive is

being used as well as problems with infinite extension of path. (MODPYTHON-114)

Stopped directories being added to sys.path multiple times when PythonImport

and PythonPath directive used. (MODPYTHON-147)

  1. … 3 more files in changeset.
PythonImport directive now uses apache.import_module() to import modules

to avoid issues with modules being loaded multiple times. (MODPYTHON-113)

PythonImport directive now allows function within module to be optionally

specified where function is called after module has been successfully

imported. (MODPYTHON-118)

  1. … 6 more files in changeset.
Allow a handler to preload data into SSI global data set for #python tag prior

to INCLUDES output filter being executed to process response, by setting the

req.ssi_globals attribute to a dictionary. Also remove filter object explicitly

from global data set after each tag instances is executed in case it causes

issues with garbage collector since request object will reference global data

resulting a cycle. (MODPYTHON-104)

  1. … 5 more files in changeset.
The apache.interpreter and apache.main_server attributes have been made

publically available. These were previously private and not part of the

public API. Bug also fixed in that the server reference wasn't always the

actual main server object. (MODPYTHON-144)

  1. … 4 more files in changeset.
Fixed unit tests to be compatible with the use of

PythonOption mod_python.mutex_directory. The unit tests can now

use a different mutex_directory, and there will not interfere with

a running apache instance. (MODPYTHON-131).

  1. … 1 more file in changeset.
The Py_Finalize() function was being called on child process shutdown. This

was being done though from within the context of a signal handler, which is

generally unsafe and would cause the process to lock up. This function is

no longer called on child process shutdown. (MODPYTHON-109)

  1. … 3 more files in changeset.
Fixed mod_python.publisher so it will not return a HTTP Bad Request

response when mod_auth is being used to provide Digest authentication.


  1. … 3 more files in changeset.
When using mod_python.publisher, the __auth__() and __access__() functions

and the __auth_realm__ string can now be nested within a class method as a

well a normal function. (MODPYTHON-27)

  1. … 3 more files in changeset.