| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
too magical so eventually explicit imports will be added to the
appropriate modules.
|
| |
|
|
| |
Modifications to use extended print syntax.
|
| | |
|
| |
|
|
|
| |
the try block. Should have no practical effect, but makes debugging
easier.
|
| |
|
|
|
| |
headers. These caused problems with the back button and didn't really
solve an existing problem.
|
| |
|
|
| |
no-cache" and "Expires: 0" to inhibit caching.
|
| | |
|
| |
|
|
|
| |
traceback, system, and environment information to the web pages. The
information is always still printed to the log files.
|
| |
|
|
|
|
|
|
| |
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? :)
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
is going to be required now.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!)
|
| |
|
|
| |
into both the error log and the HTML page.
|
| |
|
|
|
|
| |
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).
|
| |
|
|
| |
portably re-raise the exception.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Python 1.5.2 will do it (for debugging)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
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.
|