Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

How to trap warnings? (no replies)

$
0
0
I'm using python 2.6 with the MySQLdb module.
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

In the past I have used _mysql_exceptions to raise exceptions for warnings.
Example
## instantiate cursor
self.__rdb = self.__conn.cursor()
## Execute a command 
try :
  self.__rdb.execute(command)
except _mysql_exceptions.Warning,e:
  ... ## exception handling here
But this approach does not appear to work any long
I'm just getting warnings of truncated data sent to stdout.
Please advise
TIA

Viewing all articles
Browse latest Browse all 384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>