In my python script I would like to trap a \"Data truncated for column \'xxx\'\" warning durnig my query using MySql.
I saw some posts suggesting the code below, but
Just to add to Thomas Wouters reply, there is no need to import the warnings module to turn them into errors. Just run your script with "-W error" (or ignore) as flag for Python.