title: Invalid Syntax for except ValueError
body: <p>I keep getting this invalid syntax error here: except ValueError: It's giving me a carat after 'except'. I am wondering if I need to line up the 'excepts' but I tried that and I still got the same syntax error. What's wrong with my code? </p>
  
  <p>Here is my code:</p>
  
  <pre><code>from subprocess import *
  import sys
  import ConfigParser
  import os
  import csv
  import getopt
  import time
  import datetime
  from datetime import date
  from time import gmtime, strftime
  import logging
  from sys import argv
  script, solution_id, input_file = argv
  
  #creating time stamp and returning as a string to add to solution id log name
  def timeIzNow():  
      full = time.strftime(" %Y-%m-%d %H:%M:%S")
  
      return full
  
  #set up logging to file
  LOG_FILENAME = solution_id  + timeIzNow() 
  logging.basicConfig(level=logging.DEBUG,
                      format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s %(process)d',
                      datefmt='%d %b %Y %H:%M:%S', 
                      filename=LOG_FILENAME,
                filemode='w')   
  # defining a Handler which writes INFO messages or higher to the sys.stderr
  console = logging.StreamHandler()
  console.setLevel(logging.INFO)
  # setting a format which is simpler for console use
  formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
  # telling the handler to use this format
  console.setFormatter(formatter)
  # adding the handler to the root logger
  logging.getLogger('').addHandler(console)
  
  #set up configuration Parser
  config = ConfigParser.RawConfigParser()
  config.read('/etc/nagios/ingestion/objectItems.cfg')
  config.read('/etc/nagios/ingestion/action.cfg')
  
  #get objects
  objects = config.get('Objects', 'objects')
  
  #get actions
  actions = config.get('Actions', 'actions')
  
  #if no object is found, run error
  assert(sys.argv[1] != None), "object does not exist"
  
  #logging debug 
  #logging.debug('object does not exist')
  
  #Get inputs and check value and path to file
  
  
  try:
      f = csv.reader(open(input_file, "rb")) 
  except FileNotFoundError:
      logging.error('No such file or directory. Please try again')   
      for line in f:
          #process (line) 
  
          for row in f:     
              if solution_id != row[2]:
                  except ValueError: 
                      logging.error('Solution ID is invalid. Please check the number and try again') 
              else:
                  print row
  
  
  
  
  
  finally: 
       print "all error checks done!"
  </code></pre>