* srinivas hn [110616 11:06]:
> Hi Tim,
>
>import warnings
>
> with warnings.catch_warnings():
> warnings.simplefilter('error', MySQLdb.Warning)
> try:
> cursor.execute(insert_query)
> conn.commit()
> return 'Success'
> except MySQLdb.Error, error:
> loggi
* srinivas hn [110616 11:06]:
> Hi Tim,
>
> Use this method it will sort tour problem.
>
> def do_query(insert_query):
>import warnings
>
> with warnings.catch_warnings():
> warnings.simplefilter('error', MySQLdb.Warning)
> try:
> cursor.execute(insert_query)
> conn.comm
On 6/16/2011 3:01 PM, Tim Johnson wrote:
* Terry Reedy [110616 10:50]:
The machinery in the warnings module is only for instances of
subsclasses of Warning. Are the warnings from MySQLdb properly such
objects? If so, what class are they?
The warnings are sent directly to stdout. No way t
* Terry Reedy [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,
* Terry Reedy [110616 10:50]:
> On 6/16/2011 11:55 AM, Tim Johnson wrote:
> >* Tim Johnson [110615 18:53]:
> >>* geremy condra [110615 18:03]:
> >>>On Wed, Jun 15, 2011 at 6:58 PM, Tim Johnson wrote:
> Using Python 2.6.5 on linux.
>
> When using MySQLdb I am getting warnings printe
Hi Tim,
Use this method it will sort tour problem.
def do_query(insert_query):
import warnings
with warnings.catch_warnings():
warnings.simplefilter('error', MySQLdb.Warning)
try:
cursor.execute(insert_query)
conn.commit()
return 'Success'
except MySQLdb.Error, e
On 6/16/2011 11:55 AM, Tim Johnson wrote:
* Tim Johnson [110615 18:53]:
* geremy condra [110615 18:03]:
On Wed, Jun 15, 2011 at 6:58 PM, Tim Johnson wrote:
Using Python 2.6.5 on linux.
When using MySQLdb I am getting warnings printed to stdout, but I would
like to trap, display and log tho
* Tim Johnson [110615 18:53]:
> * geremy condra [110615 18:03]:
> > On Wed, Jun 15, 2011 at 6:58 PM, Tim Johnson wrote:
> > > Using Python 2.6.5 on linux.
> > >
> > > When using MySQLdb I am getting warnings printed to stdout, but I would
> > > like to trap, display and log those warnings.
> <..
* geremy condra [110615 18:03]:
> On Wed, Jun 15, 2011 at 6:58 PM, Tim Johnson wrote:
> > Using Python 2.6.5 on linux.
> >
> > When using MySQLdb I am getting warnings printed to stdout, but I would
> > like to trap, display and log those warnings.
<.>
> Have you tried
> http://docs.python.
On Wed, Jun 15, 2011 at 6:58 PM, Tim Johnson wrote:
> Using Python 2.6.5 on linux.
>
> When using MySQLdb I am getting warnings printed to stdout, but I would
> like to trap, display and log those warnings.
>
> In the past I have used _mysql_exceptions.Warning, but that approach
> is not working i
Using Python 2.6.5 on linux.
When using MySQLdb I am getting warnings printed to stdout, but I would
like to trap, display and log those warnings.
In the past I have used _mysql_exceptions.Warning, but that approach
is not working in this case.
My cursor is created with the relevant following co
11 matches
Mail list logo