title: Key Error when key is in dictionary
body: <p>Just trying to pull some lat/lon info from EXIF data on a bunch of photos, but code is throwing a <code>KeyError</code> even though that key is used (successfully) later on to print specific coordinates. </p>
  
  <p>Dictionary in question is "<code>tags</code>" - <code>'GPS GPSLatitude'</code> and <code>'GPS GPSLongitude'</code> are both keys in <code>tags.keys()</code>; I've triple checked.</p>
  
  <p>So any intuition on why <code>tags['GPS GPSLatitude']</code> &amp; <code>tags['GPS GPSLongitude']</code> are throwing key errors?</p>
  
  <pre><code>import os
  import exifread
  
  output = dict()
  output['name'] = []
  output['lon'] = []
  output['lat'] = []
  
  for file in os.listdir(path):
      if file.endswith(".JPG"):
          full_path = path + file
          print (file) #check to ensure all files were found
          output['name'].append(file) #append photo name to dictionary
          f = open(full_path, 'rb') #open photo
          tags = exifread.process_file(f) #read exifdata
  #       lon = tags['GPS GPSLongitude'] #this + next line = one method
  #       output['lon'].append(lon)
  #       output['lat'].append(tags['GPS GPSLatitude']) # = cleaner second method
          for tag in tags.keys():
              if tag in ('GPS GPSLongitude','GPS GPSLatitude'):
                  print ("Key: %s, value %s" % (tag, tags[tag])) #successfully prints lat/lon coords with 'GPS GPSLongitude' and 'GPS GPSLatitude' as keys
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>Here's the output of <code>print (tags.keys())</code> -- you'll see <code>GPS GPSLatitude</code> and <code>GPS GPSLongitude</code> in there. Also, have manually checked all the photos in the subset I'm using have GPS data.</p>
  
  <p><code>dict_keys(['GPS GPSImgDirection', 'EXIF SceneType', 'MakerNote Tag 0x0006', 'GPS GPSDestBearing', 'Thumbnail XResolution', 'EXIF BrightnessValue', 'GPS GPSAltitude', 'GPS GPSLongitude', 'EXIF LensSpecification', 'GPS GPSAltitudeRef', 'GPS GPSSpeedRef', 'GPS GPSDestBearingRef', 'EXIF WhiteBalance', 'Thumbnail ResolutionUnit', 'EXIF FocalLengthIn35mmFilm', 'EXIF SceneCaptureType', 'Image Model', 'MakerNote Tag 0x0008', 'Image Make', 'EXIF ShutterSpeedValue', 'MakerNote Tag 0x0007', 'EXIF ExifImageWidth', 'EXIF LensModel', 'Image YResolution', 'EXIF ComponentsConfiguration', 'Image GPSInfo', 'EXIF ISOSpeedRatings', 'EXIF ExposureMode', 'EXIF Flash', 'EXIF FlashPixVersion', 'GPS GPSLatitudeRef', 'EXIF ExposureBiasValue', 'Thumbnail JPEGInterchangeFormatLength', 'Thumbnail Compression', 'Image YCbCrPositioning', 'EXIF MakerNote', 'EXIF FNumber', 'JPEGThumbnail', 'MakerNote Tag 0x0001', 'EXIF ColorSpace', 'EXIF SubSecTimeDigitized', 'Thumbnail JPEGInterchangeFormat', 'MakerNote Tag 0x0004', 'EXIF SubjectArea', 'Image ResolutionUnit', 'EXIF SensingMethod', 'Image DateTime', 'Image Orientation', 'EXIF ExifVersion', 'Image ExifOffset', 'GPS GPSImgDirectionRef', 'MakerNote Tag 0x0014', 'Thumbnail YResolution', 'EXIF DateTimeOriginal', 'MakerNote Tag 0x0005', 'EXIF LensMake', 'EXIF DateTimeDigitized', 'MakerNote Tag 0x0003', 'GPS GPSTimeStamp', 'EXIF ExposureTime', 'GPS Tag 0x001F', 'EXIF SubSecTimeOriginal', 'GPS GPSLatitude', 'Image Software', 'EXIF ApertureValue', 'GPS GPSDate', 'EXIF ExposureProgram', 'GPS GPSSpeed', 'EXIF ExifImageLength', 'EXIF MeteringMode', 'GPS GPSLongitudeRef', 'EXIF FocalLength', 'Image XResolution'])</code></p>
  
  <p>Traceback</p>
  
  <pre><code>---------------------------------------------------------------------------
  KeyError                                  Traceback (most recent call last)
  &lt;ipython-input-14-949ba89a1248&gt; in &lt;module&gt;()
       16 #        lon = tags["GPS GPSLongitude"]
       17 #        output['lon'].append(lon)
  ---&gt; 18         output['lat'].append(tags['GPS GPSLatitude'])
       19         for tag in tags.keys():
       20             if tag in ('GPS GPSLongitude','GPS GPSLatitude'):
  
  KeyError: 'GPS GPSLatitude'
  </code></pre>
  
  <p>Link to photo: <a href="https://drive.google.com/a/cornell.edu/file/d/0B1DwcbbAH1yuTEs0cUhhODdlNnc/view]" rel="nofollow">https://drive.google.com/a/cornell.edu/file/d/0B1DwcbbAH1yuTEs0cUhhODdlNnc/view</a></p>
  
  <p>Output of the print statement for this photo</p>
  
  <pre><code>IMG_6680.JPG
  Key: GPS GPSLongitude, value [76, 29, 353/20]
  Key: GPS GPSLatitude, value [42, 26, 5069/100]
  </code></pre>