title: Python json.loads not able to parse json string
body: <p>I'm just working on a side project and having trouble getting the <code>json</code> module to parse a json object I've stored in a text file. The text file contains a list of newline separated json objects.</p>
  
  <p>Thus far, I have this code which I've confirmed is retrieving each full json line, then feeding it to <code>json.loads()</code>:</p>
  
  <pre><code>def load_save_game(file_name):
      save_game = []
      with open(file_name) as f:
          for line in f.readline():
              save_game.append(json.loads(line))
      return save_game
  </code></pre>
  
  <p>When I run this, I get a rather long traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File ____, line 70, in &lt;module&gt; 
      main()
    File ____, line 66, in main
      view = ViewerWindow(load_save_game('played/20_05_2016 16-04-31.txt'))
    File ____, line 60, in load_save_game
      save_game.append(json.loads(line))
    File "C:\Python27\lib\json\__init__.py", line 338, in loads
      return _default_decoder.decode(s)
    File "C:\Python27\lib\json\decoder.py", line 366, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "C:\Python27\lib\json\decoder.py", line 382, in raw_decode
      obj, end = self.scan_once(s, idx)
  ValueError: Expecting object: line 1 column 1 (char 0)
  </code></pre>
  
  <p>I suspect that the problem may be related to encoding, but upon looking into the matter, I've seen that the JSON library can be picky about things such as the capitalization of truth values, dangling commas and single quotes rather than double quotes. </p>
  
  <p>Python 2.7 appears to use the <a href="https://docs.python.org/2/library/json.html" rel="nofollow noreferrer">RFC 7159 and ECMA 404</a> specifications for json, so I used a free online <a href="https://jsonformatter.curiousconcept.com/" rel="nofollow noreferrer">json validator</a> to see if the json was badly formed. It was successfully validated for all standards of json, so python should be quite happy with the input.</p>
  
  <p>I've hosted one line of the <a href="http://pastebin.com/swuk4MPt" rel="nofollow noreferrer">json on pastebin</a>, the only difference being that there is <em>no whitespace</em> in <a href="http://www.upload.ee/files/5827092/20_05_2016_16-04-31.txt.html" rel="nofollow noreferrer">the file</a>, which I've also uploaded. </p>
  
  <p>I've looked for solutions online and tried a few different ones, such as capitalizing truth values, replacing all single quotes, and decoding the text from ascii.</p>