Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #111886

Possible to capture cgitb style output in a try/except section?

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!fu-berlin.de!uni-berlin.de!not-for-mail
From Malcolm Greene <python@bdurham.com>
Newsgroups comp.lang.python
Subject Possible to capture cgitb style output in a try/except section?
Date Tue, 26 Jul 2016 06:11:04 -0400
Lines 11
Message-ID <mailman.125.1469527867.22221.python-list@python.org> (permalink)
References <1469527864.2996118.676987281.0EE8893F@webmail.messagingengine.com>
Mime-Version 1.0
Content-Type text/plain
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de 6zcZCymeb2IpIegRDz80AwzFQkg3RD6FY+jA9ZdeONcA==
Return-Path <python@bdurham.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'clause': 0.07; 'propagate': 0.09; 'received:internal': 0.09; 'exception': 0.13; 'output': 0.13; 'from:addr:python': 0.16; 'magic.': 0.16; 'malcolm': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'script': 0.25; 'terminating': 0.29; 'subject:/': 0.30; 'point': 0.33; 'traceback': 0.33; 'except': 0.34; 'handle': 0.34; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'received:10': 0.37; 'received:66': 0.38; 'thank': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'header:Message-Id:1': 0.61; 'believe': 0.66; 'capture': 0.66; 'subject:Possible': 0.84; 'subject:try': 0.84
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=bdurham.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=fd2 0V8QYUWt9Q2hLnNiBlQb+U/E=; b=kiZnbV3hV4rsxsA5aZu9vUv/IyYSasLXcC4 4NxSHHrfmlxMgi+rQN78m3EwR6PIK2CYlxdOS/fh3kNgsRuxOi4GIotHNRQsNnoZ VuyOxmvD6vgrZdTFRZWVbFurrWHWXMMWakkTczzZeZHeAmgjpje9xPN+Ky0A52MN rHkQ0cBo=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=fd20V8QYUWt9Q2hLnNiBlQb+U/E=; b=IOZz8 JZyb6kiVaU9oobCk1rE6KZzZBIi1GKK+EeIGKGl+PzdyTW5Bw6D9eX0x2PGbymsL OVa9jw2q9B58x0aS4m61zDOdfOknRtNYybzDx4JWcQZrwkQkxzsKn7iyYx0E1Tod CB8/vK8EChZ7Txu0tHtSIbBd2GMNw2ch02fsEo=
X-Sasl-Enc d5Dzzg9j02FEMdqVlwHzx9eZaQ7XIy2V8VLNJUF7G6nP 1469527864
X-Mailer MessagingEngine.com Webmail Interface - ajax-3c2832c2
X-Content-Filtered-By Mailman/MimeDel 2.1.22
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <1469527864.2996118.676987281.0EE8893F@webmail.messagingengine.com>
Xref csiph.com comp.lang.python:111886

Show key headers only | View raw


Is there a way to capture cgitb's extensive output in an except clause
so that cgitb's detailed traceback output can be logged *and* the except
section can handle the exception so the script can continue running?
 
My read of the cgitb documentation leads me to believe that the only way
I can get cgitb output is to let an exception propagate to the point of
terminating my script ... at which point cgitb grabs the exception and
does its magic.
 
Thank you,
Malcolm

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Possible to capture cgitb style output in a try/except section? Malcolm Greene <python@bdurham.com> - 2016-07-26 06:11 -0400
  Re: Possible to capture cgitb style output in a try/except section? Steven D'Aprano <steve@pearwood.info> - 2016-07-26 23:40 +1000

csiph-web