title: python traceback exception global name not defined
body: <p>I have the below code that writes a file and prints any exception.</p>
  
  <p>Currently, i get a exception as the folder is not available(thats valid) but I get a </p>
  
  <pre><code>error
  
   "global name 'exc_info' is not defined"...
  </code></pre>
  
  <p>Code</p>
  
  <pre><code>try:
          with open(tmp_file_upload + uploadfile.raw_filename,'w') as open_file:
                  open_file.write(uploadfile.file.read())
      except Exception,err:
          import traceback
          exc_info = sys.exc_info()
          traceback.print_exception(*exc_info)
          print "File write failed"
  </code></pre>
  
  <p>Full trace:</p>
  
  <pre><code>[Wed Mar 18 16:28:48 2015] [error] [client 10.172.16.81]   File "/web/docs/bottle.py", line 861, in _handle
  [Wed Mar 18 16:28:48 2015] [error] [client 10.172.16.81]     return route.call(**args)
  [Wed Mar 18 16:28:48 2015] [error] [client 10.172.16.81]   File "/web/docs/bottle.py", line 1725, in wrapper
  [Wed Mar 18 16:28:48 2015] [error] [client 10.172.16.81]     rv = callback(*a, **ka)
  [Wed Mar 18 16:28:48 2015] [error] [client 10.172.16.81]   File "/web/docs/GUI/PBottleApp.py", line 293, in datasets
  [Wed Mar 18 16:28:48 2015] [error] [client 10.172.16.81]     exc_info = sys.exc_info()
  [Wed Mar 18 16:28:48 2015] [error] [client 10.172.16.81] NameError: global name 'exc_info' is not defined
  </code></pre>