> How do I get the "(11004, 'host not found')" part? > More importantly, where is the answer documented that I should > have looked? Look at the traceback module from the Python standard library. If you just wish to print the exception, do the following: import traceback try: nosuchobject except: traceback.print_exc() HTH! Heiko.