title: Python json dump
body: <p>I have a JSON file that looks like this:</p>
  
  <pre><code>{"environment": "production", 
   "classes": 
      {"nfs::server": {"exports": ["/srv/share1","/srv/share3"]}}
  }
  </code></pre>
  
  <p>When I run the following code using Python 3.6</p>
  
  <pre><code>fp=open('example.json', 'r')
  data=json.load(fp)
  
  print(50*'-')
  print(json.dumps(data, indent=4))
  print(50*'-')
  json.dump(data, sys.stdout, indent=4)
  </code></pre>
  
  <p>I get the output:</p>
  
  <pre><code>--------------------------------------------------
  {
      "environment": "production",
      "classes": {
          "nfs::server": {
              "exports": [
                  "/srv/share1",
                  "/srv/share3"
              ]
          }
      }
  }
  --------------------------------------------------
  {
      "environment": "production",
      "classes": {
          "nfs::server": {
              "exports": [
                  "/srv/share1",
                  "/srv/share3"
              ]
          }
      }
  }%
  </code></pre>
  
  <p>My question is why is the extra <code>%</code> included in the <code>json.dump</code> output compared to the <code>json.dumps</code> string?   It is not an artifact of the OS because if I provide a file object instead of <code>sys.stdout</code> it also gets written to the file. </p>