title: Fixing "TypeError: '_io.TextIOWrapper' object is not subscriptable" in python script
body: <p>I'm trying to store some data in a config.json for a bot that I'm working on, but I keep getting the same error every time I attempt to run it.</p>
  
  <p>I'm running Python 3.7.3, latest version of the rewrite. I've attempted moving around the config.json file around to no avail. I'm probably missing something incredibly obvious, but I don't know what.</p>
  
  <p>Where the exception is being raised:</p>
  
  <pre class="lang-py prettyprint-override"><code>with open("config.json", "r") as infile:
      try:
          CONFIG = json.load(infile)
          _ = infile["token"]
          _ = infile["owner"]
  
      except (KeyError, FileNotFoundError):
          raise EnvironmentError(
              "Your config.json file is either missing, or incomplete. Check your config.json and ensure it has the keys 'token' and 'owner_id'"
          )
  </code></pre>
  
  <p>Expected Result: Code pulls <code>token</code> and <code>owner</code> from the file, and proceeds to run the bot.</p>
  
  <p>Actual Result: Bot doesn't get launched. Traceback output -</p>
  
  <pre><code>  File "/Users/prismarine/Desktop/Project_Prismarine/core.py", line 11, in &lt;module&gt;
      _ = infile["token"]
  TypeError: '_io.TextIOWrapper' object is not subscriptable
  </code></pre>