Can't write long JSON output to text file
<p>I have a long string (8,315 characters) worth of JSON, but I can't seem to write it to a .txt file using Python without it being truncated.</p>

<p>I write the JSON to a text file and then upload it via FTP, but both the .txt file on my system and the .txt file on the FTP server are truncated.</p>

<p>Here's the code:
</p>

<pre><code># Upload the results
host = ftputil.FTPHost('ftp.website.com', 'username', 'password')
jsonOutput = json.dumps(full_json)
f = open('C:/Comparison.txt', 'w')
f.write(jsonOutput)
host.upload('C:/Comparison.txt', '/public_html/Comparison.txt')
f.close()
print jsonOutput
</code></pre>

<p>The JSON output in the console is valid and whole, but it is truncated in the .txt file that is written (and then the .txt file after it is uploaded).</p>

<p>Most of the time, the output will end at <code>http://www.digikey.com/product-detail/en/A000073/1050-10</code> when the full URL is actually <code>http://www.digikey.com/product-detail/en/A000073/1050-1041-ND/3476357</code> (and then of course, it cuts off the rest of the JSON)</p>

<p>I'm not sure if this makes any difference, but I also tried <code>f.write(re.escape(jsonOutput)</code> with the same results.</p>

<p>Can anyone help with this?</p>
