Verify JSON Data

Gene Heskett gheskett at shentel.net
Mon May 26 12:44:52 EDT 2014


On Monday 26 May 2014 11:58:06 Chris Angelico did opine
And Gene did reply:
> On Tue, May 27, 2014 at 1:37 AM, Gene Heskett <gheskett at shentel.net> 
wrote:
> > Just for S&G, and without checking the version numbers of anything,
> > this may not be all that bulletproof a test:
> > 
> > gene at coyote:~$ echo '[1, 2, 3]' | json_xs -t null 2>/dev/null; echo
> > $? 127
> > gene at coyote:~$ echo '[1; 2, 3]' | json_xs -t null 2>/dev/null; echo
> > $? 127
> > 
> > Old, buntu 10.04.4 LTS system, all up to date security patches wise.
> > kernal 3.13.9, PAE on a quad core phenom.
> > 
> > Interesting result.  Source of error? DamnedifIknow.
> 
> Return value 127 might well mean that json_xs isn't installed. It's
> very difficult for a non-program to tell you whether JSON is valid or
> not :) So I'd be checking 'which json_xs' before continuing.
> 
> ChrisA

And locate comes back empty. So much for that. ;-)

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS



More information about the Python-list mailing list