title: Issues reading json from txt file
body: <p>I have a json string in a txt file and I'm trying to read it to do some other procedures afterwards. It looks like this:</p>
  
  <pre><code>with open('code test.txt', 'r', encoding=('UTF-8')) as f:
      x = json.load(f)
  </code></pre>
  
  <p>I know the json is valid, but I'm getting:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python33\lib\json\decoder.py", line 368, in raw_decode
      obj, end = self.scan_once(s, idx)
  StopIteration
  
  During handling of the above exception, another exception occurred:
  
      Traceback (most recent call last):
        File "C:\Users\rodrigof\Desktop\xml test\xml extraction.py", line 334, in &lt;module&gt;
          user_input()
        File "C:\Users\rodrigof\Desktop\xml test\xml extraction.py", line 328, in user_input
          child_remover()
        File "C:\Users\rodrigof\Desktop\xml test\xml extraction.py", line 280, in child_remover
          x = json.load(f)
        File "C:\Python33\lib\json\__init__.py", line 274, in load
          parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
        File "C:\Python33\lib\json\__init__.py", line 319, in loads
          return _default_decoder.decode(s)
        File "C:\Python33\lib\json\decoder.py", line 352, in decode
          obj, end = self.raw_decode(s, idx=_w(s, 0).end())
        File "C:\Python33\lib\json\decoder.py", line 370, in raw_decode
          raise ValueError("No JSON object could be decoded")
      ValueError: No JSON object could be decoded
  </code></pre>
  
  <p>I used this <a href="http://jsonlint.com/" rel="nofollow">website</a> to check if the string is valid. If I use <code>.loads()</code>, I get a different error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\rodrigof\Desktop\xml test\xml extraction.py", line 334, in &lt;module&gt;
      user_input()
    File "C:\Users\rodrigof\Desktop\xml test\xml extraction.py", line 328, in user_input
      child_remover()
    File "C:\Users\rodrigof\Desktop\xml test\xml extraction.py", line 280, in child_remover
      x = json.loads(f)
    File "C:\Python33\lib\json\__init__.py", line 319, in loads
      return _default_decoder.decode(s)
    File "C:\Python33\lib\json\decoder.py", line 352, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  TypeError: expected string or buffer
  </code></pre>
  
  <p>Originally the json was embeded in my script like this:</p>
  
  <pre><code>json_text="""json stuff here"""
  </code></pre>
  
  <p>And didn't get any errors. Any ideas on how to fix this???</p>
  
  <p>Running python 3.3.3 just in case.</p>
  
  <p>Thanks!!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Just some random (valid) json on the txt and I get the same issue. This os one of the ones i tried:</p>
  
  <pre><code>{"data":
      {"mobileHelp":
          {"value":
              {
              "ID1":{"children": [1,2,3,4,5]},
              "ID2":{"children": []},
              "ID3":{"children": [6,7,8,9,10]}
              }
          }
      }
  }
  </code></pre>
  
  <p>Which is valid as well as per jsonlint.com.</p>