title: Unable to parse yaml file python
body: <p>I have a sample YAML file and I'm unable to parse it using PyYAML library.</p>
  
  <p><code>setup.yml</code>:</p>
  
  <pre><code>key: HostName
  deviceid: port1
  </code></pre>
  
  <p>Python code</p>
  
  <pre><code>with open('../configs/setup.yml') as stream:
      try:
          print 'yaml.data ==', yaml.load(stream)
          print 'yaml.data ==', type(yaml.load(stream))
          # print 'yaml.data ==', dict(yaml.load(stream))
          data = yaml.safe_load(stream)
          self.device_id = data['deviceid']
          self.key = yaml.load(stream)['key']
      except yaml.YAMLError as exc:
          print(exc)
  </code></pre>
  
  <p>The <code>yaml.load(stream)</code> type is <code>Nonetype</code>, I thought it should be a dictionary.</p>