summaryrefslogtreecommitdiff
path: root/scripts/driver
Commit message (Collapse)AuthorAgeFilesLines
* run_main(): When running the cgi, redirect stdout to a cStringIO, andbwarsaw2002-10-011-0/+7
| | | | | | | only if the cgi script runs to completion successfully do we write the entire output to the real stdout (connected to the web server). This way, if any exception occurs during the rendering of the page (e.g. in "print doc.Format()") we won't mess up the diagnostics page.
* run_main(): Because the site-packages path hacking no longer happensbwarsaw2002-02-121-6/+2
| | | | | | | | in Defaults.py, we need to arrange for this script to import paths.py to pick up the correct site-packages prefixed sys.path. Because we do this, we can delete the sys.path.insert() call, which was redundant.
* run_main(): A simplification -- I want to try to not pre-loadbwarsaw2001-12-311-10/+0
| | | | | | | | | Mailman/pythonlib/cgi.py because I'd like for Mailman to start using the default Python module now that we require at least Python 2.0 (or should that be Python 2.1?). I'm sure any disparity between the cgi.py modules will show up in beta testing. But if it looks okay, I'll remove our copy of cgi.py.
* run_main(): Don't stick Mailman.i18n._ in the builtins.bwarsaw2001-06-271-11/+2
|
* run_main(): Gross and temporary hack to put `_' in the builtins. It'sbwarsaw2000-12-071-0/+9
| | | | | too magical so eventually explicit imports will be added to the appropriate modules.
* Turn STEALTH_MODE back on for the 2.1 development cycle.bwarsaw2000-12-071-17/+17
| | | | Modifications to use extended print syntax.
* In preparation for 2.0 final, turn on STEALTH_MODEbwarsaw2000-09-291-1/+1
|
* run_main(): Moved the initialization of logger local to None outsidebwarsaw2000-09-271-4/+4
| | | | | the try block. Should have no practical effect, but makes debugging easier.
* print_traceback(), top-level: Remove the Cache-control: and Expires:bwarsaw2000-07-221-4/+0
| | | | | headers. These caused problems with the back button and didn't really solve an existing problem.
* print_traceback(), top-level: Include HTTP headers "Cache-control:bwarsaw2000-07-201-0/+4
| | | | no-cache" and "Expires: 0" to inhibit caching.
* Add Emacs helper at top of file.bwarsaw2000-07-191-0/+1
|
* Added a variable STEALTH_MODE which can be set to true to inhibitbwarsaw2000-06-051-38/+49
| | | | | traceback, system, and environment information to the web pages. The information is always still printed to the log files.
* print_environment(): Reveal even more secrets about Mailman'sbwarsaw2000-04-061-7/+37
| | | | | | | | operating environment, namely some key sys module attributes (version, prefix, etc.). We're going to need a way to scale back this reporting for the Web pages in case folks do not want to reveal this much information. And hey, since 2.0 will have no bugs, this stuff is all moot anyway, right? :)
* run_main(): During call to the Cgi's main routine, set sys.stderr tobwarsaw2000-04-041-7/+5
| | | | | | | | the logger object so they can simply sys.stderr.write() to get error messages out to logs/error. No need to set sys.__stderr__ and sys.__stdout__; we're requiring at least Python 1.5.2 now.
* Remove the commented out extended open() function, since Python 1.5.2bwarsaw2000-03-211-30/+5
| | | | is going to be required now.
* Changes to workaround some bogus clients which either don't include abwarsaw1999-01-081-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | content-type header, or include a bogus one. cgi.py FieldStorage.__init__(): if there is no content-type header, use text/plain for inner parts, but application/x-www-form-urlencoded for outer parts. Honor any existing content-type header. Lower down, if the content-type header is something we don't understand, default to text/plain for inner parts, but application/x-www-form-urlencoded for outer parts. This patch will be proposed for Python 1.5.2 driver run_main(): Play some games to get Mailman's special cgi.py module. We import it from Mailman.pythonlib.cgi, but then we jam this module into sys.modules['cgi'] so all those imports in all those Mailman.Cgi scripts get our special one (without having to hack all those scripts!)
* print_traceback(): A few changes to get the Mailman version numberbwarsaw1999-01-071-2/+10
| | | | into both the error log and the HTML page.
* move the import of Mailman.Utils.reraise into the debugging-open()bwarsaw1998-12-101-13/+13
| | | | | | definition -- the only place it's used. Also, comment out the whole def and __builtin__ hack. This debugging stuff probably shouldn't go into the release (although its use should be documented).
* open(): in the debugging version, use Mailman.Utils.reraise() tobwarsaw1998-11-031-4/+3
| | | | portably re-raise the exception.
* What about this one?bwarsaw1998-08-041-1/+1
|
* Sighbwarsaw1998-08-041-1/+1
|
* Another trivial rsync related changebwarsaw1998-08-041-1/+1
|
* One more timebwarsaw1998-08-031-3/+4
|
* Guess again :-)bwarsaw1998-08-031-2/+2
|
* Contrived change (to test rsync'ing)bwarsaw1998-08-031-1/+1
|
* open(): put filename on the e object as an attribute to mimic the waybwarsaw1998-08-031-0/+1
| | | | Python 1.5.2 will do it (for debugging)
* Very substantially rewritten. The old driver script let too manybwarsaw1998-07-311-60/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uncaught exceptions through to the top level. Uncommented out the open() definition. I think this is very helpful during the beta debugging phase. We'll comment this out for 1.0 release (it also won't be necessary in Python 1.5.2, but nobody has that yet!) Exception printing has been changed so that the MultiLogger is no longer necessary. Removes one more potential crash, but also rationalizes print_exception() and print_environment(). There's always exactly two places information goes: 1. To a plain text log file. This could be sys.__stderr__ if no explicit log file is given -- e.g. the Web server's log file. 2. To an HTML sink. This will always be sys.stdout (since we use the `print' statement), and will generally always be connected to the input of the Web browser. Log file printing happens first, just in case (it's better that the server knows what's happening), but we always try to print both. `Main' has been rewritten also. We now do not catch any problems with import sys. If sys can't be imported, then the Python installation is royally screwed -- even `print' won't work! Better to just let the catastrophy percolate up to the Web browser. Even so this should almost never happen. Poke __stderr__ and __stdout__ into the sys module if they aren't already there. GvR says this is a 1.5.1 feature, but we can make it work well enough for older versions of Python, and it's convenient. Give one final shot at printing the traceback and environment if the exception percolates all the way up out of run_main(). This time, just print them to stderr (usually meaning the Web server's error log). Should this fail too, do whatever we can not to generate an end-user visible server error.
* run_main(): initialize logger and multi to sys.stderr. This is inbwarsaw1998-07-291-0/+5
| | | | | | | case anything breaks between the start of this function and the creation of the real objects, otherwise the calls in the except branch will fail, kicking us back to a low-level exception. using sys.stderr isn't great, but it's better than nothing.
* Added a useful debugging hack (commented out).bwarsaw1998-07-221-0/+21
|
* Use the new Mailman.Logging package to provide better logging onbwarsaw1998-07-021-20/+23
| | | | | | | | errors. Now all tracebacks get sent to the user as HTML *and* logged to logs/error, although the format of the output is slightly different (not HTML in the latter case). Some rearranging of code, simplification, etc.
* New CGI driver script that attempts to import the real script from thebwarsaw1998-06-191-0/+147
Mailman.Cgi package. Be as paranoid as possible about catching exceptions and reporting them as HTML (which has saved my butt numerous times already :-). See the comments in the file for things that can still cause Server errors.