Json error : "end is out of bounds"?
<p>I'm having an issue I can't understand. I sending a json data as string via Redis (as a queue) and the receiver is throwing the following error :</p>

<pre><code>[ERROR JSON (in queue)] - {"ip": null, "domain": "somedomain.com", "name": "Some user name", "contact_id": 12345, "signature": 
"6f496a4eaba2c1ea4e371ea2c4951ad92f41ddf45ff4949ffa761b0648a22e38"} =&gt; end is out of bounds
</code></pre>

<p>The code that throws the exception is the following :</p>

<pre><code>try:
    item = json.loads(item[1])
except ValueError as e:
    sys.stderr.write("[ERROR JSON (in queue)] - {1} =&gt; {0}\n".format(str(e), str(item)))
    return None
</code></pre>

<p>What is really odd, is that if I open a python console and do the following :</p>

<pre><code>&gt;&gt;&gt; import json
&gt;&gt;&gt; s = '{"ip": null, "domain": "somedomain.com", "name": "Some user name", "contact_id": 12345, "signature": "6f496a4eaba2c1ea4e371ea2c4951ad92f41ddf45ff4949ffa761b0648a22e38"}'
&gt;&gt;&gt; print s
</code></pre>

<p>I have no issue, the string (copy/pasted in the Python console) yield no errors at all, but my original code is throwing one!</p>

<p>Do you have any idea about what is causing the issue?</p>