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


Groups > comp.lang.python > #7762

Re: Trapping MySQLdb warnings

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <tim@johnsons-web.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'debug': 0.03; 'terry': 0.07; 'python': 0.08; 'question:': 0.09; 'received:64.4': 0.09; 'substitute': 0.09; 'cursor': 0.16; 'reedy': 0.16; 'result:': 0.16; 'class,': 0.16; 'header:In-Reply-To:1': 0.21; 'suspect': 0.25; 'object': 0.26; 'raise': 0.28; 'done': 0.32; 'to:addr :python-list': 0.33; 'header:User-Agent:1': 0.35; 'charset:us- ascii': 0.36; 'connection': 0.37; 'something': 0.37; 'but': 0.38; 'subject:: ': 0.38; 'skip:s 20': 0.39; 'itself.': 0.39; 'either': 0.39; 'to:addr:python.org': 0.39; 'monte': 0.84; 'warning.': 0.84
Date Thu, 16 Jun 2011 11:13:11 -0800
From Tim Johnson <tim@johnsons-web.com>
To python-list@python.org
Subject Re: Trapping MySQLdb warnings
References <20110616015837.GA1885@johnsons-web.com> <BANLkTint8YP9W7hUnvYh4nmMo_6h0WPXTA@mail.gmail.com> <20110616023829.GB1885@johnsons-web.com> <20110616155533.GD1885@johnsons-web.com> <itdj4h$mrn$1@dough.gmane.org>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <itdj4h$mrn$1@dough.gmane.org>
Organization AkWebsoft
User-Agent Mutt/1.5.20 (2009-06-14)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.36.1308251593.1164.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 82.94.164.166
X-Trace 1308251593 news.xs4all.nl 49045 [::ffff:82.94.164.166]:41897
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7762

Show key headers only | View raw


* Terry Reedy <tjreedy@udel.edu> [110616 10:50]:
<...> 
> Substitute specific MySQLdb warning class, whatever it is, for Warning.
  Hmm! Consider the following code:
try :
  self.__rdb.execute(S)
  raise MySQLdb.Warning('danger, danger Monte Python') ## just for grins
except MySQLdb.Warning,e:
  std.debug("e",e,0,0,'mysql.py:195',0)  ## DEBUG GLOBAL
## result:
INSPECTING `e'  (F:mysql.py:195):
danger, danger Monte Python
## Question:

Am I initializing the cursor to raise warnings? I *so* rusty at this, but I
suspect that something needs to be done with either the instantiation of the
'parent' connection object or the cursor object itself.

-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com

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


Thread

Re: Trapping MySQLdb warnings Tim Johnson <tim@johnsons-web.com> - 2011-06-16 11:13 -0800

csiph-web